The jump between the two apps is achieved by [[uiapplication sharedapplication] Openurl:url] this way.
1. First set the URL address of the first app
2. Then set the URL address of the second app
3. When a jump is required
NSString *urlstring = [NSString stringWithFormat:@ "appjumpsecond://%@", Textfield.text]; [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:urlstring]];
I'm going to pass TextField's words over here.
Likewise, this is true on the second page.
NSString *urlstring = [NSString stringWithFormat:@ "appjumpfirst://%@", Textfield.text]; [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:urlstring]];
So we can jump to each other.
4. Handling data passed in the past
The TextField data is transmitted on it and received at the Appdelegate.
-(BOOL) application: (uiapplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (id) annotation method.
Setting properties in Appdelegate
@property (nonatomic, strong) Rootviewcontroller *rvc;
Add in the didfinishlaunchingwithoptions method
SELF.RVC =*nc == NC;
Add code block
-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (ID) annotation{ = [[url host] Stringbyreplacingpercentescapesusingencoding:nsutf8stringencoding]; return YES;}
Enables TextField to display data passed from another page.