简体   繁体   中英

Custom url scheme in salesforce android app

I am looking to implement a custom url scheme (eg myapp://) so that my android app can be opened on the browser and/or from an email link. I understand that there are a lot of answers here that point to intent filters in the AndroidManifest.xml as the answer, but I have not been able to get it to work. I am not sure how to get my app to detect those intent filters. If someone can help me on this, that would be great.

Thank you.

Try a tutorial like this one: http://www.vogella.com/articles/AndroidIntent/article.html#intentfilter in the part where it says <data android:scheme="http"/> set it to <data android:scheme="myapp"/>

Then in the Activity you put this IntentFilter in, just go ahead and do a getIntent().getData() and that will give you the URI. Then you can process as you like. For example if you send myapp://opencontact/joe_bob you can pull out the parts and open your ContactProfileActivity or whatever and show the user Joe Bob...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM