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 = [[Rootviewcontroller alloc] init]; Uinavigationcontroller *NC = [[Uinavigationcontroller alloc] INITWITHROOTVIEWCONTROLLER:SELF.RVC]; Self.window.rootViewController = NC;
Add code block
-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (ID) annotation{ self.rvc.textField.text = [[URL host] Stringbyreplacingpercentescapesusingencoding:nsutf8stringencoding]; return YES;}
Enables TextField to display data passed from another page.
iOS two apps jump, pass value, Bubu buckle, bubuko.com
Jump, pass value between iOS two apps
Jump between iOS two apps, pass the value of the implementation