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.
Related
I have two versions of my app, version 1 and version 2. In version 2 I added support for a new universal link /sign-up. I updated my app site association file to add /sign-up to the list of supported deep link URLs.
In version 1 I am returning false for /sign-up when I receive the UIApplicationDelegate callback for - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
In version 2, I am returning true for the same method and signing up the user.
The issue is that iOS is opening my app even for users on version 1, even though that version doesn't actually support this link.
How can I version universal links such that this sort of thing cannot happen in the future?
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.
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.
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)
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