Handoff between Watch and Phone Parse.com doesn't show user as logged in - ios

So I've pretty much finished my first WatchKit app for one of my iOS apps, in which I use Parse.com as a backend. I've setup a shared app container and shared keychain as per the Parse documentation and everything is working fine.
However I started to implement handoff to allow users to open my app on there phone from the lock screen if they're using it on there watch. However sometimes when the app opens, the user does not appear as logged in.
There seems to be 2 situations, only 1 of which seems to do this.
• If the app was already open in the background, when the user opens the app via handoff and the lock screen, the user is logged in correctly.
• However, if the app is not open in the background, when the user opens the app via handoff and the lock screen, the user will not be logged in.
I have a feeling it's an authentication issue with the app not being authenticated with Parse when opened in the background, but I'm not sure.
Any help would be appreciated here, as it's my last thing to work out.

Related

Use Google-Signin to log into App but stay signed out on Safari

I have integrated Google-Signin into an iOS Application and it works well as far as signing in or signing up is concerned.
The only problem is that, I dont want the user to be logged into Google on iOS Safari after I have used Google-Signin.
I have verified that, before I log into my app, I am signed out of google in iOS Safari. Then I go to my app and I use Google-Signin to log into my app, once that is done I then go back to iOS Safari and refresh the google page and all of a sudden it shows me signed in with the same account that I used to log in to the app.
How do i just use Google-Signin to simply log into the app and stay logged out of iOS safari?
I've researched the topic and it seems the only way to perform logout is to use SFSafariViewController to open provider's logout page
For Google this is https://accounts.google.com/logout
This way requires some additional UX changes, because this action will open Safari window for a second and user should not be confused.
Try to use GIDSignIn it will open safariviewcontroller inside the app.
You can change which content from your Google Account syncs with the Apple apps on your device. You can also remove your Google Account from your Apple apps at any time, which stops syncing.
To change what syncs or remove your Google Account:
On your iPhone or iPad, open the Settings app.
Select Mail, Contacts, Calendars or Safari
Choose the account you'd like to edit or remove.
Make the changes you want.
To change what content syncs: Next to the content you want to sync, turn on the switch. Turn it off for content you don't want to sync.
To remove your account: Select Delete Account.

Login to Facebook Without Leaving App

I am using the Facebook SDK and I use the standart way of logging in a user (I use a FBSDKLoginButton). The problem is that when the user clicks on the view my app goes to the background and safari opens.
My app got rejected from the appstore because of this.
How can I make the login happen inside my app?

Does app-argument on Apple Smart Banner get passed to app on install?

I've implemented a Apple Smart Banner for my app, including a app-argument with a URL I'd like the app to open on my site. I thought that would pass through when the user installs the app, but it doesn't seem to.
The steps - user visits page, doesn't have app installed, clicks View, goes to app store, installs app and then taps Open in the App Store. The app opens, but it doesn't appear to get the app-argument passed in. Note that if they then go back to the web page, the Smart Banner now says Open and that works and passes the app-argument, just not on the first install.
Have I misunderstood what is supposed to happen? If so, this makes the Smart Banner pretty much useless for me.
Gary
From the docs:
If the app is already installed on a user's device, the banner intelligently changes its action, and tapping the banner will simply open the app. If the user doesn’t have your app on his device, tapping on the banner will take him to the app’s entry in the App Store. When he returns to your website, a progress bar appears in the banner, indicating how much longer the download will take to complete. When the app finishes downloading, the View button changes to an Open button, and tapping the banner will open the app while preserving the user’s context from your website.
It only sends the URL param if the app is opened via the banner. If it's opened via AppStore or via SpringBoard, it won't send it.
You can do it with branch.io. More info here.
tl;dr
What Branch does is generate a custom URL specific for your device and uses the same unique configuration to fetch the data when the application is opened. Thus, you need to include their SDK into your app in order to get those arguments you want to send.
Maybe this is a bug?
From: http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
When the app finishes downloading, the View button changes to an Open button, and tapping the banner will open the app while preserving the user’s context from your website.

Prevent IOS to shutdown an app when it app switch to facebook for login and permission request

I am really stuck on this problem and I need your help!
I'm doing an ipad game with unity and the social network plugin from prime31.
The situation:
When you arrive to the end of level, the game gives you your score and ask if you want to submit it to facebook. If you do, In my script I've done a system that checks if you are logged in, if you aren't it ask you to login and then the system checks if the app has the publish permissions and if not it ask you the permission. If all theses if are true it posts a message to your wall straight. So hopefully the login/asking part needs to be done only once.
The problem:
When the ipad swap between the game and the facebook app to login, the ipad shutdown the game for saving memory. I've tried to reduce the scene, but it's hard to reduce it more than it is. So I thought maybe I should open that facebook login and authorisation inGame. For that I tried working with this:
setSessionLoginBehavior(FacebookSessionLoginBehavior.ForcingWebView);
And it does exactly what I want, it opens a small window in game, doesn't crash all good really. But the problem, in this solution, is that it only works for the login, and when I ask the publish permission it switches back to the facebook app to ask the permission and therefore crashes.
After more research, it seems that it's not doable to control the ask permission behavior.
So back to square one, how can I prevent IOS to shutdown my game while the user connects to facebook. I'm still looking to reduce the scene.
I heard of using the app url and sending data for the app (my game) launch after leaving the facebook app and therefore ask the ipad to relaunch the app at a specific scene. But that would be really the last solution because it's going to take a lot of rework to make that happened.
If you have another suggestions to work around this problem I'm up for it. All I need is login -> ask for publish permissions -> post and come back to the end of level screen of my game.
Thanks for the help
Put simply, once your app is backgrounded, if iOS wants to shut it down, you can't prevent that from happening.
The best thing you can do is save the state of your app before handing over to the facebook app for the authentication side of things, and then reload your state when the app starts up again. You'll want to handle applicationWillResignActive:, applicationDidEnterBackground:, applicationDidBecomeActive: and applicationWillBecomeActive:.
The App States and Multitasking section of the iOS App Programming Guide explains how you can do this.
I think you should check for FBDialog for iOS 5 and beneath. And FBNativeDialogs for iOS 6.
These will pop a window on the top of your app, so I guess it will still be running. And for iOS 6's FBNativeDialogs
Provides methods to display native (i.e., non-Web-based) dialogs to
the user. Currently the iOS 6 sharing dialog is supported.

iOS not receiving user to user app requests

I am sending app requests from an iOS native app using Facebook SDK dialog. I have created a canvas app and set the iTunes ID (using a valid ID from a different app in the store now, since mine is not). The requests arrive at desktop www site, and show up under "App and Games>Invites from friends". But, they do not show up on iOS native Facebook app, unless I first do Facebook SSO with my app. Then, my app bookmark appears in FB, and new requests increment the counter.
How do I get the requests to show up on iOS before my app is installed? Other peculiar thing that may be related, is I get no activity under "Notifications" on iOS, only the app bookmark. On desktop, I see the Notifications globe flash with a red badge at first logon, but then the badge goes away and nothing is there, although the requests appear under "Apps and games". This seems not totally consistent as some people who have tested my app get the expected Notification behavior, but I never do on my own FB account. Could it be because if added and removed the app repeatedly for testing?
Any clues?
My problem seems to have been something fouled up in the Facebook database, probably as a result of my various misfires in early development. At some point it began working correctly without any changes on my end.

Resources