Deep linking callback issues in iOS11 - ios

I have implemented deep linking in my app using URL schema which is working properly in all versions of iOS except 11. The issue is when I load AppURLSchema:// in the device browser it launches the app but none of the appDelegate methods gets called to get the deep linking URL so that I can perform deep linking so that user will be able to see different content based upon the URL.
None of the following functions are getting called:
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
This is not an issue on iOS 10, it seems to have been introduced in iOS 11.
Any help will be appreciated.
Thanks!!

I'm facing the same problem and I discovered that the SDK Firebase integrated in my app is blocking the following callback: application:openURL:options.
Without configuring Firebase, all is working ok.

It's not just Configuring Firebase SDK causing this issue. With Firebase SDK it's working fine but There is Localytics SDK also integrated in my app and there is some conflict between FIREBASE and LOCALYTICS SDKs due to which my app was not getting the callback.
So I just removed Firebase framework based upon the priority and everything started working fine.

As mentioned in Localytics Documentation, integrations for both platforms can lead to conflicts, particularly around the handling of deeplinks.
You can prevent Firebase from swizzling the methods in your AppDelegate by adding FirebaseAppDelegateProxyEnabled set to NO in your app's info.plist as described in Firebase documentation.

Related

Sign-in with google doesn't work properly on iOS 9

I am implementing Sign-In with google in my application using cocoa-pods.
I have followed everything in https://developers.google.com/identity/sign-in/ios/sign-in.
I have added URL schemes as well.
But when I tried to login with google account in iOS 9, it opens browser and after authentication app doesn't come back to my app and it stuck on browser. But functionality works well on iOS 8. Can anybody help?
OpenURL methods are as follows:
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary *)options {
return [[GIDSignIn sharedInstance] handleURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
}
Also
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
return [[GIDSignIn sharedInstance] handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
You didn't give us enough info. But from what you said that it works fine in iOS 8 and not in iOS 9 my guess is getting blocked by AppTransportSecurity (ATS) settings.
https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33
In iOS 9, the SDK should be using SFSafariViewController and not opening out to the browser.
Are you using the latest version of the SDK? It's 4.0.0 and was released back in May.
Tip: If you installed via Cocoapods then ensure that you have run pod repo update to ensure you've got the latest copy of the spec repo.

Dropbox chooser crashing in iOS

I have integrated with dropbox chooser in iOS application. It worked till recently. Now it started crashing. Is there any change in dropbox SDK?
I could access dropbox files view in chooser and select file. But when it returns to appdelegate, it is crashing.
URL response i got :
db-appkey://1/chooser?files=%7B%22link%22%3A%22https%3A%5C%2F%5C%2Fdl.dropboxusercontent.com%5C%2F1%5C%2Fview%5C%2Frsoof482pcg9d1m%5C%2FGet%2520Started%2520with%2520Dropbox.pdf%22%2C%22bytes%22%3A692088%2C%22name%22%3A%22Get%20Started%20with%20Dropbox.pdf%22%2C%22is_dir%22%3Afalse%2C%22icon%22%3A%22https%3A%5C%2F%5C%2Fwww.dropbox.com%5C%2Fstatic%5C%2Fimages%5C%2Ficons64%5C%2Fpage_white_acrobat.png%22%2C%22isDir%22%3Afalse%2C%22thumbnails%22%3A%7B%7D%7D
Code in appdelegate.m
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url sourceApplication:(NSString *)source annotation:(id)annotation
{
if ([[DBChooser defaultChooser] handleOpenURL:url]) {
// This was a Chooser response and handleOpenURL automatically ran the
// completion block
return YES;
}
return NO;
}
Crashing at line [[DBChooser defaultChooser] handleOpenURL:url] with below error :
2016-02-11 15:57:40.413 Backflipt[985:420495] -[__NSCFConstantString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x37768968
Check attached screenshot at exception breakpoint in Xcode
URL response with latest dropbox chooser (version : 4.2.4) :
db-8343b03llcys1pw://1/chooser?files={"link":"https://dl.dropboxusercontent.com/1/view/rsoof482pcg9d1m/Get%20Started%20with%20Dropbox.pdf","bytes":692088,"name":"Get Started with Dropbox.pdf","is_dir":false,"icon":"https://www.dropbox.com/static/images/icons64/page_white_acrobat.png","isDir":false,"thumbnails":{}}
URL response with dropbox chooser (version : 3.9) :
db-8343b03llcys1pw://1/chooser?files=[{"is_dir":false,"thumbnails":{},"isDir":false,"link":"https://dl.dropboxusercontent.com/1/view/kdehqo4khfi0ifo/Getting%20Started.pdf","bytes":249159,"name":"Getting Started.pdf","icon":"https://www.dropbox.com/static/images/icons64/page_white_acrobat.png"}]
Why latest dropbox version is returning single file dictionary instead of array of files dictionary which causes parsing logic to crash.
What is the quick fix for this? writing our own parsing logic?
February 10, 2016: Dropbox is aware of and working on this issue.
February 11, 2016: This should be fixed now with version 4.2.5 of the official Dropbox iOS app.

Parse Facebook Login not executed, PFDateFormatter unrecognized selector

I am building an iOS application with Parse. However when I try to log in with facebook I get the following error in the log:
[PFDateFormatter preciseStringFromDate:]: unrecognized selector sent to class 0x101da7628
The app doesn't crash, but the login just never gets executed.
It's funny because I have the exact same code for the login in another app, where it is working just fine. I triple checked all the included frameworks, my plist info for the facebook app, updated everything but still the same error.
I of course have included [PFFacebookUtils initializeFacebook] in my AppDelegate.m file and also implemented the required method
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [FBAppCall handleOpenURL:url
sourceApplication:sourceApplication
withSession:[PFFacebookUtils session]];
}
as well as
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
[FBAppCall handleDidBecomeActiveWithSession:[PFFacebookUtils session]];
}
Does anybody have an idea on what might be causing this?
I fixed this issue by making sure I had the latest version of ParseFacebookUtils framework. For some reason Cocoapods was not updating to the most recent version, maybe it was the order that I ordered the pods in? I had to uninstall the pertinent pods and then reinstall them for it to work. Here is what my podfile looks like now:
pod 'Facebook-iOS-SDK'
pod 'Parse'
pod 'ParseFacebookUtils'
The pod install terminal output looks like this:
Using Bolts (1.1.3)
Using Facebook-iOS-SDK (3.22.0)
Installing Parse (1.6.2)
Installing ParseFacebookUtils (1.6.2)

How many people have installed my app as a result of Facebook ads?

I've followed the instructions on this page for my Xcode project (ios app): https://developers.facebook.com/docs/ios/getting-started/
installed the Facebook SDK for iOS
obtained Facebook App ID
configured Xcode project
archived Xcode proj, submitted to Apple, approved and live
And I've created and run ads for app installs however how do I know how many people have installed my app as a result of the ads? There is nothing showing top left of the ads page....just zero???? Nothing showing in my Facebook Developer account.
I've clearly missed a pretty obvious step...can someone please shed some light?
You're probably not calling [FBAppEvents activateApp] on applicationDidBecomeActive:.
Check also if you have a FacebookAppID key on your target's Info.plist.
You AppDelegate needs to look like this:
#import "AppDelegate.h"
#import <FacebookSDK.h>
#implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// stuff
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBAppEvents activateApp];
}
#end

iOS File Association

I've set up file association in my iOS application for KML and KMZ files.
I've the app is not opened, then selecting "Open With APPNAME" from Safari will work.
If the app is already open, however, then all it does it make the app prominent.
I've implemented both - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
and
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Neither are being called.
Any hints as to why?
The result: The test device was using an earlier OS version (iOS 4.0) than my other devices (iOS 4.3.5, iOS 5.0b7). Prior to iOS4.2, a different method was used to handle opening via file association.

Resources