nordnet / cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
https://github.com/nordnet/cordova-universal-links-plugin/issues/160
MIT License
349 stars 529 forks source link

How to redirect? #76

Closed fahmi182 closed 5 years ago

fahmi182 commented 8 years ago

How i redirect after i found detail page in app..

`test {

onNewsDetailedPageRequested: function(eventData) {

  var ori_url = eventData.url;
  var base_url = cordova.file.applicationDirectory+'www/';
  var urls = purl(ori_url);
  var file_url = urls.attr('file'); 
  var new_file_url = file_url.substring(0, file_url.lastIndexOf("."));             
  var target_url = 'launch.html?slug=';
  var finished = base_url + target_url + new_file_url;
  // Now i have :  file:///android_asset/www/launch.html?slug=segala-yang-perlu-anda-tahu-tentang-samsung-galaxy-note-7
  alert('Showing after to user details page for some news ' + finished);
  //document.location = finished;   
  // do some work to show detailed page
},

`

nikDemyankov commented 8 years ago

If you just need to redirect to some page by loading url - you can use:

window.location = finished;
fahmi182 commented 8 years ago

i try many redirect method just not work, error file not found, the apps just load file same as url original, example if i test homepage with adb shell:

fahmi182 commented 8 years ago

Thanks @nikDemyankov

I solve the problem, this plugin not support because i using custom scheme url, i wanna ask? are this plugin support custom url scheme? and how to use custom url scheme?

nikDemyankov commented 8 years ago

No, it doesn't support custom schemes. The idea of this plugin (and universal links in general) is that you use http/https schemes as for normal links.

nordnet-deprecation-bot commented 5 years ago

👋 Hi! Thank you for your interest in this repo.

đŸ˜ĸ We are not using nordnet/cordova-universal-links-plugin anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹī¸ Please see #160 for more information.