简体   繁体   中英

ios app URL scheme for facebook

I want to share my app URL via FB. lets say the url scheme is set to "www.myapp.com", in that case my URL string would be "www.myapp.com://?myParam=123".

Problem is, fb app opens this URL in the app itself and changes the URL to "www.myapp.com/?myParam=123".

For any one else looking for this, I used UIActivityViewController and eliminated facebook and twitter from the sharing options, using "excludedActivityTypes" property.

UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@

                                            [[NSString stringWithFormat:@"iOS: %@",[NSURL URLWithString:[NSString stringWithFormat:@"www.abc.in://?shareid=%@", _stateManagerShared.shareID]]],

                                             [NSString stringWithFormat:@"Android: %@",[NSURL URLWithString:[NSString stringWithFormat:@"www.abc.in/shareid=%@", _stateManagerShared.shareID]]]]

                                                                             applicationActivities:nil];

    activityVC.excludedActivityTypes = @[UIActivityTypePostToFacebook, UIActivityTypePostToTwitter];

    [self presentViewController:activityVC animated:YES completion:nil];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM