StoreContext.GetAppLicenseAsync().AddOnLicenses sometimes returns an empty list when the user has a license - windows-store-apps

I have an XBOX only app in the Microsoft Store that has been up for a while. The app has an add-on.
I use a very simple code to get the list of licenses in order to check if the user has add-on.
See below.
StoreAppLicense appLicense = await StoreContext.GetAppLicenseAsync();
var licenses = appLicense.AddOnLicenses.Select(item=> item.Value).ToList();
//Here I just save this in my log to see what is in the list
LogInfo("licenses: " + string.Join(',', licenses.Select(l => l.SkuStoreId).ToArray()));
Ok, so most of the time this code works fine. But there can be instances where the StoreAppLicense returns an empty list, even when the user HAS the license.
This has been a problem that has happened sometimes since I published the add-on, but was always fixed by reinstalling the app. Lately, even after a reinstall; the issue reappears.
What is worst, this even happened to me two days ago. I reinstalled the app and it worked fine; but after restarting the app it happened again. Then after some hours when I came back home it "solved itself".
I also have the suspicion that sometimes the StoreContext.GetAppLicenseAsync() method never returns and that causes the app to "hang".
Needless to say, customers get upset at me and give me bad reviews for something that is beyond my control.
What should I do in this situation? Can you even trust the StoreContext library?
Has someone seen this happening before?

Related

Facebook Graph API returns a different response on a different script but same -not invalid- tokens

I am trying to make a simple python script that posts a text message to a facebook page using requests.
I actually managed to succeed this feat, however, when I add the same logic to a bigger project of mine, a certain request returns a different json.
According to this page https://developers.facebook.com/docs/pages/access-tokens I can exchange the short lived user token I generate in the graph explorer tool for a long lived one that lasts 60 days. This worked for me until now. When I run the same functions, same variables on another .py file that includes other logic as well the request does not return this line:
"expires_in": SECONDS-UNTIL-TOKEN-EXPIRES
And of course later on if I continue the logic and use the token it returns (which is the same) for, let's say, a make_post function the request prints
{'error': {'message': '(#200) If posting to a group, requires app being installed in the group, and \\\n either publish_to_groups permission with user token, or both manage_pages \\\n and publish_pages permission with page token; If posting to a page, \\\n requires both manage_pages and publish_pages as an admin with \\\n sufficient administrative permission', 'type': 'OAuthException', 'code': 200, 'fbtrace_id': 'AqYMMeOcOniWAGgEEtsEURs'}
Why does it not successfully return, the user token had not expired and it has the requires rights. Furthermore I tested this in a smaller .py file and it worked.
Another thing I found out here https://developers.facebook.com/support/bugs/523165725596520/?join_id=f1ff8392b49675c here is that other people have actually reported the same issue but it has been closed as 'intended by design' however there is no information of a solution.
Running the request in my browser also does not work correctly.
Do you have any ideas? I am completely clueless.
Thank you very much in advance
As #CBroe in a comment said, the expires_in didn't have anything to do with my error. The token it returns if valid. The issue I had later on had to do with the url I was parsing

Angularfire2 valueChanges() returns data after I deleted it manually in Firebase

I am querying a subcollection in Firestore in an Angular6 Web App. On the first run, my function went through, but I was missing some information, so I had to delete it. I deleted the data in the subcollection manually in Firebase.
This is my query:
this.inviteSub = this.afs.collection('groups').doc(myGroup).collection<any>('invitations').valueChanges().subscribe(invites => {
console.log(invites);
});
When I execute my function on the client (Chrome) again, the valueChanges returns me the data that actually has been deleted.
I already tried a hard refresh by CTRL+F5 of the website. I also closed the browser. I also tried to unsubscribe when I at ngOnDestroy. But none of my efforts "cleared" up my 'invites'.
Can anyone help me how I "refresh" my browser / function / 'invites'?
UPDATE:
I still could not figure out what the issue causes, but I changed my App to Angular 6. So, I also changed this in my question.
I found a solution by myself. In my 'app.module.ts' I had the persistence enabled AngularFirestoreModule.enablePersistence() and changed it to AngularFirestoreModule

GoogleWebAuthorizationBroker sometimes crashes the app

I have a Windows Phone 8.1 app with Google login, which uses the
GoogleWebAuthorizationBroker.AuthorizeAsync
method. 90 % of the time, the authentication works, however, occasionally, the app just crashes on this line (I am logging right before it, so I am sure). I have the call wrapped inside try - catch, but that doesn't seem to work - exception is never caught.
I am also sure I am calling the method on a UI thread, I am using the DispatcherHelper from MVVMLight for that.
The fact that I am not able to reproduce the crash complicates this a lot, I have not experienced it with debugger attached, only in Release mode, on target device, run locally.
Do you guys have any ideas / clues / pointers? I know I'm not providing a lot of information, but I don't have any..
EDIT> So the error now happened with debugger attached - and the app just froze, last message in Ouput window was
"WinRT information: Cannot get credential from Vault"
But that's normal behavior..

IMobileServiceSyncTable PullAsync doesn't return

I currently use Azure Mobile Services with Offline Sync and I it has been working fine. However I now have come to a problem I can't seem to debug. On the PullAsync it never returns, never goes to the Web API, it never errors, it just seems to be stuck somewhere and I don't know where.
IMobileServiceSyncTable<ResponseType> responseTypeTable = MobileService.GetSyncTable<ResponseType>();
await responseTypeTable.PullAsync(responseTypeTable.Where(c => c.CompanyId == companyId));
I use identical code elsewhere with a different type and it works well.
The only thing that happens is the Windows Phone emulator UI locks up, I can press buttons on the keyboard but the input or buttons are all frozen.
I get this on the Debug Output
The thread 0xb80 has exited with code 259 (0x103).
After a 5 seconds and that's about it. Breakpoints everywhere, nothing happening.
The method was in a Command (I'm using MVVMLight). When I call the function on the class initialization and just hold the value it works fine. There is obviously some bug that occurs when calling PullAsync on an event, in an async RelayCommand but getting the call out of there solves the issue.
I'll leave it at that unless anyone comes back with why it is actually happening. This is just a workaround at the moment.

How to clear AIR cache for working Facebook logout?

I am developing an AIR application that is supposed to run on desktop and mobile platforms.
For most Facebook functionality, I use the official GraphAPI for Flash, version 1.8.1.
To use the app, the user must login to Facebook, this works easily by first calling FacebookMobile.init(), and if it reports that the user is not logged in, logging in like this:
var webView :StageWebView = new StageWebView();
webView.stage = stage;
webView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
FacebookMobile.login(handleLoginResult, stage, new Array(), webView);
All of this works very well, but logging out does not work as expected. Calling
FacebookMobile.logout(handleLogout);
does log out the user from Facebook, it seems, and handleLogout is always passed a true as first parameter. After this logout, when FacebookMobile.init() is called, it also correctly reports the user as not logged in. So I call the login() method from above again.
Then, the WebView opens, but closes itself immediatly, automatically logging in the user that just logged out, without showing any kind of Facebook login screen. But I want to be able to log in another user, by having to type in email and passwort.
Probably I should mention that the logging out happens when the application starts. The user can't log out himself, the application does so when starting, so that the user should be forced to login each time. Yes, this has a reason ;)
I'm sure this is some kind of caching problem, but how can I solve it with Flash/AIR?
Bit late but better than nothing right? I have seen this issue before when I was experimenting with the OAUTH api...
Found the potential solution while looking for a separate issue but with regards to caching/cookies...
This post explains what you need to do:
http://cookbooks.adobe.com/post_Cannot_logout_from_Facebook_on_Android_devices-19254.html
Basically its not a very pretty solution, but what it does is you manually delete the folders where the caching is happening.
Hope this helps.
Implementing "reallyLogout" from this answer for a similar issue worked for me:
https://stackoverflow.com/a/8199505/952779
Clear internet explorer cache & cookies, .. and it will log you out from StageWebView facebook login
UPDATE: Change also the app id from the descriptor xml file