retryios handleopenurll怎么解决

swift使用shareSDK分享为什么出现retryHandleOpenURL错误_百度知道
swift使用shareSDK分享为什么出现retryHandleOpenURL错误
我有更好的答案
提供服务的话,只做分享登录还是可以的吧
其他类似问题
为您推荐:
swift的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁如何通过URL打开APP_百度知道
如何通过URL打开APP
提问者采纳
最近要在IOS中实现一个应用启动另外一个应用的功能,搜了一些资料,使用UIApplication的openURL:的方法就能实现,现在整理和大家分享一下!  注册自定义URL协议  首先被启动的应用需要向iPh穿攻扁纪壮慌憋苇铂俩one注册一个自定义URL协议。这是在你的项目文件夹的info.plist文件进行的(就是你改变应用程序图标的同一个文件)。  Step1. 右键,选择“Add Row”Step2. Key值选择“URL types”  Step3. 打开“Item 0″,然后为该key增加一个URL identifier。可以是任何值,但建议用“反域名”(例如 “com.fcplayer.testHello”)。  Step4. 在“Item 0”下再加一行。  Step5. 选择“URL Schemes” 作为Key。  Step6. 输入你的URL协议名 (例如“testHello://” 应写做“testHello”)。如果有必要,你可以在这里加入多个协议。  操作截图如下:  访问自定义URL  在主应用程序中通过访问自定义URL启动另外一个应用:    [csharp] view plaincopy  NSURL * myURL_APP_A = [NSURL URLWithString:@&testHello://&];  if ([[UIApplication sharedApplication] canOpenURL:myURL_APP_A]) {  NSLog(@&canOpenURL&);  [[UIApplication sharedApplication] openURL:myURL_APP_A];  }      自定义处理URL  有些时候我们除了启动还需向另外一个应用发送参数,这是也可以通过自定义的URL来实现,如:  testHello://  testHello://com.fcplayer.testHello  testHello://config=1&abar=2  这时我们在被启动应用中就必须进行自定义处理,在delegate中实现该消息(Cocos2d加在AppDelegate中),例如:  - (BOOL)application:(UIApplication *)applicationhandleOpenURL:(NSURL*)url {
// Do something withthe url here }  通常,我们会从参数中解析出URL以便在视图中显示或者存储到UserPreference。下面的例子把URL存储为User Preference的url变量中或者打印出来:    [csharp] view plaincopy  -(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url  {  if (!url) {
return NO; }  NSString *URLString = [url absoluteString];  NSLog(@&%@&,URLString);  //[[NSUserDefaults standardUserDefaults] setObject:URLString forKey:@&url&];  //[[NSUserDefaults standardUserDefaults] synchronize];  return YES;  }
其他类似问题
为您推荐:
您可能关注的推广
app的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁ios - How to handle UIApplication handleOpenURL with multiple URL's - Stack Overflow
to customize your list.
Announcing Stack Overflow Documentation
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
I have an app that will be using both Facebook and Instagram API's, both of which require me to use this delegate method:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [PFFacebookUtils handleOpenURL:url];
and this is the code provided by instagram:
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [self.instagram handleOpenURL:url];
As you can see, this is a problem because I can only return one URL handler, but I need to be able to decide which one.
In my app delegate, I have commented out the Instagram option above and left only Facebook. As expected, Facebook will work just fine, but I get this error when I tap authorize on Instagram:
Obviously, Facebook is trying to handle the return URL from Instagram so it will error.
Is it plausible to check the URL to see if it contains the app ID for each service I am trying? So if URL contains the instagram ID, then return the instagram handler, if it contains the Facebook ID, then return the Facebook Handler.
Any help would be great, thanks!
4,12742342
Facebook and Instagram both had you setup a custom URL scheme for their services, so we will use that to filter the URL.
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
if ([[url scheme] isEqualToString:INSTAGRAM_SCHEME])
return [self.instagram handleOpenURL:url];
if ([[url scheme] isEqualToString:FACEBOOK_SCHEME])
return [PFFacebookUtils handleOpenURL:url];
return NO;
Where you define your variables as
#define INSTAGRAM_SCHEME @"ig"
#define FACEBOOK_SCHEME
exactly as you did in your Info.plist file
27.1k13107167
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled如何使用友盟 Cocos2d-x 分享组件实现 Android/iOS 分享功能_百度知道
如何使用友盟 Cocos2d-x 分享组件实现 Android/iOS 分享功能
我有更好的答案
首先我简单介绍一下组件压缩包的组成
实现Cocos2d-x中跨平台分享功能,需拷贝到您项目的Classes文件夹中;
原生的Android和iOS社会化组件SDK,需要您将库和资源拷贝到对应平台的项目中;
组件的集成文档;
Umeng_Cocos2dx_Demo_V1.0
Android部分的demo文件,可以安装在手机上看一下简单的分享效果和样式
Cocos2d-x虽然是一个跨平台的引擎,但是对于Android和IOS平台来说,具体的集成方式还是有一定的区别,这里分别介绍Android和IOS平台集成中不同的地方,然后再集中介绍跨平台通用的部分。
Android平台集成步骤:
下载Cocos2d-x组件(下载地址) 并且将jar包添加到build path 路径下,将res资源文件夹加入到你工程对应资源文件下。将Platforms/Android/controller目...
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁handleOpenURL 回调方法不调用 - 简书
下载简书移动应用
写了5894字,被147人关注,获得了176个喜欢
handleOpenURL 回调方法不调用
以前做分享、和第三方登录的时候,没发现收不到系统回调方法。最近项目做这个功能时,微博sso授权和QQsso授权返回APP时,总是不见在appdelegate调用系统回调方法。就是下面这个:
-(BOOL)application:(UIApplication *)application openURL:(NSURL
*)url sourceApplication:(NSString *)sourceApplication annotation:
(id)annotation{
BOOL result = [UMSocialSnsService handleOpenURL:url wxApiDelegate:nil];
if (result == FALSE)
//调用其他SDK,例如支付宝SDK等
NSLog(@"添加了系统回调,在appdelegate类里");
result = [Pingpp handleOpenURL:url withCompletion:nil];
然后就不停对照友盟的开发文档,发现自己的配置都没有错误啊, 自己分别检查了:
友盟的appkey, 微信的appid、appsecrt、新浪微博的回调地址
又检查了 info.plist 的白名单,如下图
没错啊, 这些都是粘的友盟的
最后检查了,URL Scheme所有的配置都没有问题
最后打开系统方法发现下面的方法, 试过之后果然调用了:OK!问题解决了
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary&NSString *,id& *)options{
BOOL result = [UMSocialSnsService handleOpenURL:url wxApiDelegate:nil];
if (result == FALSE){
//调用其他SDK,例如支付宝SDK等
NSLog(@"添加了系统回调,在appdelegate类里");
result = [Pingpp handleOpenURL:url withCompletion:nil];
最后总结:iOS9以后, 上面两个方法可能都要调用, 以前只调最上面哪一个方法,哈哈,终于解决了……
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
被以下专题收入,发现更多相似内容:
分享 iOS 开发的知识,解决大家遇到的问题,讨论iOS开发的前沿,欢迎大家投稿~
· 24448人关注
· 5934人关注
学习从点滴开始 !
(PS: 拒绝部分投稿的文章仅仅是由于专题内已收录相关知识点的文章, 并非是投稿的文章技术含量不够好, 望谅解.)
· 4707人关注
选择支付方式:

我要回帖

更多关于 蒲公英 的文章

 

随机推荐