You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/24 20:14:47 UTC

[GitHub] [cordova-ios] driesdriessen opened a new issue #723: Pass Launch Parameters to Cordova App

driesdriessen opened a new issue #723: Pass Launch Parameters to Cordova App
URL: https://github.com/apache/cordova-ios/issues/723
 
 
   # Feature Request
   
   ## Motivation Behind Feature
   It is possible to launch an app with start-up parameters. This is useful for opening an app in a specific context. An example is opening an editor with a specific file. Unfortunately startup parameters currently are not passed to the Cordova app.
   
   ## Feature Description
   An app can be launched with parameters: myapp?var1=foo
   
   In the Cordova app, the parameters can be picked up:
   var url = new URL(globalThis.location;);
   var var1 =  url.searchParams.get("var1");
   
   
   ## Alternatives or Workarounds
   For IOS I currently copy this code in xCode manually to didFinishLaunchingWithOptions in CDVAppDelegate.m 
   
       // Set your app's start page by setting the <content src='foo.html' /> tag in config.xml.
       // If necessary, uncomment the line below to override it.
       NSURL *url = launchOptions[UIApplicationLaunchOptionsURLKey];
       if (url)
       {
           self.viewController.startPage = [@"index.html?" stringByAppendingString:url.query];
       } else {
           self.viewController.startPage = @"index.html";
       }
   
   It would be nice if this can become a part of the standard IOS implementation, and if a similar solution can be created for other platforms.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org