2015-04-03 7 views
9

Sto provando ad avviare la mia app nativa tramite un URL (condiviso via email ecc.). Sembra che Android risponda solo agli URL dei link diretti HTTP (ad es., http://myapp.com/stuff) e che iOS risponda solo agli URL dei link diretti personalizzati non HTTP (ad esempio, myapp: // stuff). Qualcuno ha trovato una soluzione unica per consentire a entrambi i sistemi operativi di aprire lo stesso URL?Collegamento profondo HTTP condiviso iOS e Android?

Inoltre, è possibile che iOS utilizzi URL di collegamento diretto HTTP? Simile a come http://youtu.be aprirà l'app iOS nativa. Facebook fa anche questo.

Grazie! :)

+0

'URL email '? Cos'è quello? – greenapps

+0

spiegato un po 'nel post –

risposta

1

Questo articolo può essere utile "schemi URL per iOS e Android": http://fokkezb.nl/2013/09/20/url-schemes-for-ios-and-android-2/

Modificato: L'idea principale di inviare all'utente un link a un sito web. Utilizzando il rilevamento della piattaforma sul server possiamo restituire il collegamento corretto:

function open() { 

    // If it's not an universal app, use IS_IPAD or IS_IPHONE 
    if (IS_IOS) { 
     window.location = "myapp://view?id=123"; 

     setTimeout(function() { 

      // If the user is still here, open the App Store 
      if (!document.webkitHidden) { 

       // Replace the Apple ID following '/id' 
       window.location = 'http://itunes.apple.com/app/id1234567'; 
      } 
     }, 25); 

    } else if (IS_ANDROID) { 

     // Instead of using the actual URL scheme, use 'intent://' for better UX 
     window.location = 'intent://view?id=123#Intent;package=my.app.id;scheme=myapp;launchFlags=268435456;end;'; 
    } 
} 
+0

Grazie. Modificato il mio post. – kengura

+0

grazie .... :-) – kleopatra

Problemi correlati