Wenfengcheng / xamarin-notes

xamarin journal
MIT License
3 stars 0 forks source link

iOS Sharing features #27

Open Wenfengcheng opened 5 years ago

Wenfengcheng commented 5 years ago

URL Scheme是什么由于苹果的app都是在沙盒中,相互是不能访问数据的。但是苹果还是给出了一个可以在app之间跳转的方法:URL Scheme。简单的说,URL Scheme就是一个可以让app相互之间可以跳转的协议。每个app的URL Scheme都是不一样的,如果存在一样的URL Scheme,那么系统就会响应先安装那个app的URL Scheme,因为后安装的app的URL Scheme被覆盖掉了,是不能被调用的。

在iOS9下,调用openUrl:打开第三方应用会有问题,无法调用相关的应用,原因是iOS9增加了URL Scheme白名单机制,只有在白名单内的应用才能调用的到,否则是无法打开第三方应用的。 iOS9下使用canOpenURL:判断某个应用是否已安装时,也需要将其URL Scheme写入到info.pist文件中。在iOS9以前是不需要的。

Steps: image

https://juejin.im/post/5a9521ae6fb9a0634a393f30 http://www.devzhang.com/14461743262337.html

Wenfengcheng commented 5 years ago

From the Apple Docs:

  • (BOOL)application:(UIApplication )application openURL:(NSURL )url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation: Asks the delegate to open a resource identified by URL

--> so, this one gets called when you open another app from your app, not when your app is opened by another app

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions: Tells the delegate that the launch process is almost done and the app is almost ready to run.

--> if you already launched your app before, and it is currently only in the background, this method will not be called again

What you want is most likely:

  • (void)applicationDidBecomeActive:(UIApplication )application or - (void)applicationWillEnterForeground:(UIApplication )application which are getting called when the app moves from the background to the foreground!

https://stackoverflow.com/questions/26341177/url-schemes-applicationdidfinishlaunchingwithoptions-handleopenurl-not-calle

Wenfengcheng commented 5 years ago

2、检查IDFA的步骤 (1)、打开终端cd到要检查的文件的根目录。

(2)、执行下列语句:grep -r advertisingIdentifier . (别少了最后那个点号)。

http://wiki.mob.com/idfa%E7%9A%84%E6%A3%80%E6%B5%8B%E5%92%8C%E9%80%9A%E8%BF%87%E5%AE%A1%E6%A0%B8-2/