is it possible to associate specific URL with Windows Phone 8.1 application?
When there is a request to open URL in format e.g. http://myservice.mydomain.com?Params... from e-mail or page in browser, my application will process an URL.
On Android it is possible in manifest with intent-filter for some activity:
...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="myservice.mydomain.com" android:scheme="http" />
</intent-filter>
...
Thanks.
You can make an URI association with a custom URI schema, like "myapp:"
Read more here: URI Associations
Related
I have 2 apps MainApp and SubApp, both have the same domain https://abc.in
what I want if https://abc.in/cart gets clicked it should trigger MainApp, and if https://abc.in/subapp/cart clicked it should trigger SubApp.
below is the intent filter declaration of both apps :-
MainApp
<intent-filter
android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="*.abc.in" />
<data android:host="abc.in" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="app" android:scheme="abc.mainapp" />
</intent-filter>
SubApp
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data
android:host="*.abc.in"
android:pathPrefix="/subapp"
android:scheme="https" />
<data
android:host="abc.in"
android:pathPrefix="/subapp"
android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="abc.in"
android:pathPrefix="/subapp"
android:scheme="abc.subapp" />
</intent-filter>
Now the problem is both the
links https://abc.in/cart
and
https://abc.in/subapp/cart
opening in MainApp most of the time.
In only 2 cases the SubApp is getting triggered with https://abc.in/subapp/cart :-
In Android 12 -> if it gets installed later after installing MainApp
Below Android 12 -> going to app info of SubApp and opening the supported links (just open and view, nothing else)
else is all the cases the MainApp getting priority.
NOTE :- I have prepared the assetlink.json file by merging both apps package name and other detail into one, and uploaded to https://abc.in/.well-known/assetlinks.json
I have 2 domains and one single app but would link from both domains to app-pages via Deep-Links.
Is it possible to link from e. g. both static.domain.com and content.domain.com into the same app with dynamic links?
Thanks in advance :)
Sure, you could add many domain as many as you want.
Just add your domains inside manifest.
<data android:host="static.domain.com" android:scheme="http"/>
<data android:host="static.domain.com" android:scheme="https"/>
<data android:host="content.domain.com" android:scheme="http"/>
<data android:host="content.domain.com" android:scheme="https"/>
So, the code look like this:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="static.domain.com" android:scheme="http"/>
<data android:host="static.domain.com" android:scheme="https"/>
<data android:host="content.domain.com" android:scheme="http"/>
<data android:host="content.domain.com" android:scheme="https"/>
</intent-filter>
Do not forget to verify your domains by adding assetlinks.json inside .well-known folder. Ensure that is accessible using https://static.domain.com/.wll-known/assetlinks.json and https://content.domain.com.com/.wll-known/assetlinks.json. Should using https for verifying your domain.
Cheers
With Android, the application opens when links xml, rss or atom are selected in Safari.
To do this, I use the Cordovan-webintent plugin, and I add following case in AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:mimeType="text/xml" />
<data android:mimeType="application/rss+xml" />
<data android:mimeType="application/atom+xml" />
<data android:mimeType="application/xml" />
</intent-filter>
And I get the file in the application with the Cordovan-webintent plugin
I can not find a solution to do the same with IOS, ie open a file with the app when the "mine type" is met.
URL scheme does not seem to fit the need.
Deep Linking Android first opens the launcher activity (not the deeply linked activity ) then the deeply linked activity as declared in Manifest file.I have followed all the steps mentioned here .
viz. Manifest contains
<activity
android:name="com.example.android.GizmosActivity"
android:label="#string/title_gizmos" >
<intent-filter android:label="#string/filter_title_viewgizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
<!-- note that the leading "/" is required for pathPrefix-->
<!-- Accepts URIs that begin with "example://gizmos”
<data android:scheme="example"
android:host="gizmos" />
-->
</intent-filter>
</activity>
and Deeply Linked activity contains
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
}
and some other activity specific code.
I had this same problem and in my case it was simply a copy and pasting issue. make sure your deep links intent filters ONLY exist under the right activity in the manifest. if you have 2 identical filters under 2 different activities, it will open the first one (logically your main activity would be your first one)
Just remove android:label="#string/filter_title_viewgizmos" from intent filter. Your code will start working.
Thanks.
I am trying to setup OAUTH for my twitter related app .I am using a callback url which gets the access token inside my application .
However I am getting the following error :-
onReceivedError -2 http://www.someurl.com/auth/twitter/callback?&oauth_token=ajGYfwX5YauPcHnUIQCjFf1pFBGmhBEhAxFv8Ej6Ns&oauth_verifier=VBWZ5HaDMwGzrzbGOUlEQhUbZmKoLzWXVRqSxBUZI The URL could not be found.
My Browser shows page not responding .
My CallBack Url =http://www.someurl.com/auth/twitter/callback .
I am using onNewIntent for receving the intent from my browser .
public void onNewIntent(Intent intent)
{
super.onNewIntent(intent);
System.out.println("Here ");
Uri uri = intent.getData();
String oauthToken = uri.getQueryParameter("oauth_token");
String oauthVerifier = uri.getQueryParameter("oauth_verifier");
}
Manifest File :-
<activity android:name=".Testing" android:launchMode="singleTask">>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="x-oauthflow-twitter" android:host="callback" />
</intent-filter>
</activity>
The call back is a bit odd, it's actually in the format scheme://host.
So for your app, based on the manifest file, it would be "x-oauthflow-twitter://callback". This means that you'll have to specify that url as the callback url in your code too.