Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <key>CFBundleURLTypes</key>
- <array>
- <dict>
- <key>CFBundleURLName</key>
- <string>com.TestApp</string>
- <key>CFBundleURLSchemes</key>
- <array>
- <string>testApp.linking</string>
- </array>
- </dict>
- </array>
- - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
- sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
- {
- // You we get the call back here when App B will try to Open
- // sourceApplication will have the bundle ID of the App B
- // [url query] will provide you the whole URL
- // [url query] with the help of this you can also pass the value from App B and get that value here
- }
- -(IBAction)openApp_A:(id)sender{
- if(![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"testApp.linking://?"]]){
- UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"App is not available!" message:nil delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
- [alert show];
- }
- }
- -(IBAction)openApp_A:(id)sender{
- if(![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"testApp.linking://?userName=abe®istered=1&Password=123abc"]]){
- UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"App is not available!" message:nil delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
- [alert show];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement