我希望当用户在iOS设备上点击Facebook上由我的应用程序共享的帖子时,可以打开我的应用程序。
如果有任何示例,请提供给我。
如果有任何示例,请提供给我。
首先从以下链接中创建深度链接URL:https://developers.facebook.com/quickstarts/1555401071407647/?platform=app-links-host。 然后它将返回类似于https://fb.me/16753168070237260的URL。 像这样将其添加到您的FBGraphObject中:
NSMutableDictionary <FBOpenGraphObject> *object = [FBGraphObject openGraphObjectForPostWithType:@"myApp:event" title:@"testing title" image:nil url:@"https://fb.me/16753168070237260" description:@""];
plist
中添加以下行。<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.test.DEMO</string>
<key>CFBundleURLSchemes</key>
<array>
<string>DEMO</string>
</array>
</dict>
</array>
<?php
echo "<script>setTimeout(function() { \n
window.location = \"https://itunes.apple.com/us/app/DEMO...\";\n
}, 25);\n
window.location = \"DEMO://?l=1\";\n
</script>";
?>
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
//add your code
}