Skip to content

Commit

Permalink
append query
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleTime authored Jan 2, 2020
1 parent 88dff3d commit a92ca0b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions open-app.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ function openApp(appID, storeFallback, appleStoreId, queries) {
var sharedApplication = UIApplication.sharedApplication;
var url = NSURL.URLWithString(appID.trim());
if (sharedApplication.canOpenURL(url)) {
// open app
var query = "?";
for(var x in queries){
query += queries[x]['key']+"="+queries[x]['value']+"&";
//Append Query
var query = "";
if(queries != null && queries.length > 0){
query = "?";
for(var x in queries){
query += queries[x]['key']+"="+queries[x]['value'];
if(parseInt(x+1)!=queries.length) query += "&";
}
}
url = url+query;
console.log(url);
url = NSURL.URLWithString(url+query);
// open app
sharedApplication.openURL(url);
return true;
}
Expand Down

0 comments on commit a92ca0b

Please sign in to comment.