How to open spotify links in both android and ios device? - android

I did a Google search for opening spotify URLs/URIs on native app, and found the following URI scheme to open the links in the native app.
spotify://spotify:artist:12Chz98pHFMPJEknJQMWvI
This above link seems to be working fine on ios devices, but i am not able to open this on android device(HTC One). Any suggestions ?

Have you tried entering just the spotify:artist:12Chz98pHFMPJEknJQMWvI in android. I believe the spotify:// may be directing it towards the app, but i think android directs its apps with a different command. Also, just in case it is the same for android, you need to have the app installed on your phone if you dont already have it for the directing command to work properly.

android refer this link
ios refer this link
some reference from above link
have run into a similar need in an app. My solution was to create a client that hits the Spotify API to return either XML or JSON of the search. For instance, if you want Muse, you would hit the API with the following URL:
http://ws.spotify.com/search/1/artist?q=muse
From the XML or JSON, you'll be able to extract the link to the particular artist within their URL scheme:
spotify:artist:12Chz98pHFMPJEknJQMWvI
Chop off the spotify:artist: portion and append that onto a Spotify artist link:
http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI
Then, using the Spotify URL scheme and UIApplication, you can open the Spotify app to that particular artist's page:
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:
#"spotify://http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI"]];
Note, using URL schemes to access features of another app is generally undocumented and can be a fragile endeavor. If Spotify in the future decides to change anything about this, it will break this functionality without warning.

The quick fix I made was to directly call the uri with any modification on the original uri.
which is 'spotify:artist:4gzpq5DPGxSnKTe4SA8HAU' or 'spotify:track:1dNIEtp7AY3oDAKCGg2XkH'

Related

How to launch an app from a SMS message in Android and iOS, along with encrypted data for the apps to use

I'm developing an app for iOS and Android that i want users to be able to launch when they receive a SMS message that contains a link.
The link includes the app package as well as encrypted data in the following format:
"com.app.myapp://?<encrypted data>" (the <> brackets are not included and the encrypted data is never over 120 characters)
On iOS, this works perfectly as the SMS link comes in correctly hyperlinked to include all of the encrypted data, the app launches and all is well.
Android on the other hand, the link comes in broken...only the "com.app.myapp" is hyperlinked, which still launches the app when clicked, but it does not pass the encrypted data. So it seems like Android is breaking the link.
One fix i had for android was to add "http://" to the beginning of the link, this kept the hyperlink fully intact in Android, but on iOS the link with http would no longer launch the app.
Also removing the ':' after the package name fixed it for Android, but again broke the iOS functionality.
I know its not an app issue, its more a Android Messages issue / possibly a link formatting issue.
Is there another solution i can try?
You cannot add http:// in front of com.app.myapp:// because they are both uri schemes. You should familiarize yourself with the difference between URI Schemes and App Links. Since you are using URI schemes to accomplish this, you should not be using .. Your URI scheme should look something like myapp:// not com.app.myapp://. This is probably why Android Messenger is ignoring everything after the ://.
An easier solution would be to use Branch SDK and pass along the encrypted data in the link data.
EDIT
Android messenger does not recognize raw URI schemes as clickable links. You probably still need to use http for android. You should look into using Android app links and iOS universal links. These take a bit more set up but should handle links in both cases

Get referring url for Android or iOS installation

We have several landing pages that link to Google Play and iOS App Store. I would love to know the landing page that a person came from within the app code. I have searched around and can't find any clear answer. Lots of gray area.
I just want to access the landing page URL in Java or Swift.
I realize iOS and Android are two separate beasts. But does anyone know how I could achieve this?
You will need to use Firebase Dynamic Links this helps you create various links using various alternatives as shown in this quote from the official Firebase source:
You create a Dynamic Link either by using the Firebase console, using a REST API, iOS or Android Builder API, or by forming a URL by adding Dynamic Link parameters to a domain specific to your app.
Then your app can access the link in code using Java or Swift and the link will work even if the user has your app already in their phone and you can set a logic to handle that too and the links are also automatically direct the user to AppStore or PlayStore depending on which device is used.
Dont worry about whether the link will work for both Android and iOS and you can use the api to access the link as this quote says.
With Dynamic Links, your users get the best available experience for the platform they open your link on. If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your native app. If a user opens the same Dynamic Link in a desktop browser, they can be taken to the equivalent content on your website.
In addition, Dynamic Links work across app installs: if a user opens a Dynamic Link on iOS or Android and doesn't have your app installed, the user can be prompted to install it; then, after installation, your app starts and can access the link.
You can get more information on dynamic links here and check if it will solve your problem.

Linking to external android apps through html

I'm a First time developer who is developing a basic WebView based app for android devices. I have some links that lead to profiles on facebook, twitter & instagram etc. At the moment whenever these links are clicked the relevant profiles open but in website form and not app. How can I make these links open the relevant app instead of the website. For example whenever I click on instagram it loads the mobile website for instagram instead of launching the actual app. Also if I have a telephone number set using href="tel: how can I set it to launch the phone app with the telephone number filled in. Sorry if these are stupid questions but I am very new to app development and am still learning. Many thanks for your time.
You will need to use the application specific URL schemes:
A good read on what this is:
https://fokkezb.nl/2013/08/26/url-schemes-for-ios-and-android-1/
Once you understand what this is you will need to do some research to find the URL scheme and correct url for every app you want to target
Example: fb://profile/
Phone number this might work: 2125551212

Android's browser do not call Application And auto search or notice invalid address

I have one problem hope you help
I wanted to call down a application from web browser (on Android) by accessing the address with the schema of the app (the app that I also declare schema).
eg myschema://site/data1/data2
However, not all browsers are successful. the browser fails, it considered uri string call application are the wrong address (and can auto search)
thank you very much
I think I understand the issue you're having.
What I've found is you can't test Deeplink schema with Google's Chrome browser unless you create a specific webpage to test the links. Anything that isn't a "valid" URL is passed to Google as a search. So if you want to use Chrome, create a small HTML page with the links you want to test and when you click on the links, a working deeplink URL will open the application.
What I do when I don't want to go to that much effort is I download the Firefox browser and paste the links into the URL bar there. That'll open the associated applications directly.
The third option is to use the ADB command line interface, see this Stack Overflow answer.

Url schema for Whatapp in android

I want to launch whatsapp from my hybrid application using phonegap. I went through the whatsapp url schemas.It is working fine with iOS . Here is the schema is used for iOS:
href = "whatsapp://send?abid=123&text=hello"
reference from :
http://www.whatsapp.com/faq/en/iphone/23559013
As described abid is address book id. If I give correct abid the application redirect to the particular contact.
But as per my reading abid is not possible in android . Currently I am using url with out abid which redirects the application to the recent chats. so is there any way to redirect the application to the particular contact ?
For Android, use Webintent plugin
EDIT
See whatsapp phonegap plugin.
iOS supports a generic URL scheme for whatsapp ("whatsapp://send?abid=").
However on Android the URL scheme is currently not supported.
This plugin implements the send-via-whatsapp functionality on Android.
Two recent solutions (July 2017)
There's been many changes in that need lately but finally after years I've found, tested and refered two new different solutions that should work with any device (one is official). I've mentioned them in THIS OTHER ANSWER (because S.O. policies I had to put a link to the solution, no duplicates).

Categories

Resources