Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. <key>CFBundleURLTypes</key>
  2. <array>
  3. <dict>
  4. <key>CFBundleURLName</key>
  5. <string>com.TestApp</string>
  6. <key>CFBundleURLSchemes</key>
  7. <array>
  8. <string>testApp.linking</string>
  9. </array>
  10. </dict>
  11. </array>
  12.  
  13. - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  14. sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
  15. {
  16. // You we get the call back here when App B will try to Open
  17. // sourceApplication will have the bundle ID of the App B
  18. // [url query] will provide you the whole URL
  19. // [url query] with the help of this you can also pass the value from App B and get that value here
  20. }
  21.  
  22. -(IBAction)openApp_A:(id)sender{
  23.  
  24. if(![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"testApp.linking://?"]]){
  25. UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"App is not available!" message:nil delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
  26. [alert show];
  27.  
  28. }
  29. }
  30.  
  31. -(IBAction)openApp_A:(id)sender{
  32. if(![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"testApp.linking://?userName=abe&registered=1&Password=123abc"]]){
  33. UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"App is not available!" message:nil delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
  34. [alert show];
  35.  
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement