i developer of basic e-commerce app has companion website. wanted try app links way direct users website screens on mobile app.
the applinks website tutorial gives following example way introduce app links app.
this possible if wanted "link" 1 screen in each app. have if want link multiple screens?
i want website able direct user home screen, search screen payment screen. there efficient way this? have add different app links on different pages?
edit
thanks response alex. i've tried follow guide android app doesn't seem work. whenever open url of website on android chrome browser nothing happens. want automatic redirect app. snippet of code (under pseudonyms names , urls).
website:
<meta property="al:android:url" content="ecommerceapp://dlogsman" /> <meta property="al:android:app_name" content="ecommerceapp" /> <meta property="al:android:package" content="com.ecommerce.app" /> <meta property="al:web:url" content="http://ecommerce.com/~dlogsman" /> android manifest:
<activity android:name="com.ecommerce.app.app" android:label="@string/app_name_ecommerce"> <intent-filter> <action android:name="android.intent.action.main"/> <category android:name="android.intent.category.launcher"/> </intent-filter> <intent-filter> <data android:scheme="ecommerceapp" android:host="open" /> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> </intent-filter> </activity> and onstart method handles intent recommended. suggestions?? again time.
as heads up, work on branch linking tool (branch.io) helps simplify deep linking across channels including facebook (and simplifying applinks nightmare)
what app links tell facebook robot how map corresponding website url native app url. it's set of metatags add site's header in order tell facebook app url call when app installed. the actual link website link. therefore, can have 1 set of applinks on given page on existing ecommerce site. in order use applinks different pages in app, you'll need have different web urls. so, you'll need have a:
http://yourecommercesite.com/home, add metatagsyourecommerceapp://homehttp://yourecommercesite.com/search, add metatagsyourecommerceapp://searchhttp://yourecommercesite.com/payment, add metatagsyourecommerceapp://payment
then, you'll need structure app deep linking. in case haven't done that, here's how set , receive url path in ios:
- add uri scheme yourecommerceapp:// plist file

- write code receive uri path
- (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { if ([[url path] hassuffix:@"home"]) { // load home view controller } else if ([[url path] hassuffix:@"search"]) { // load search view controller } else if ([[url path] hassuffix:@"payment"]) { // load payment view controller } return yes; } and here's how in android:
- setup app manifest receive intents yourecommercesite://. need add inside
<activity></activity>tags
<intent-filter> <data android:scheme="yourecommercesite"/> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> </intent-filter> - in onstart of activity receives intent, add following code:
@override protected void onstart() { super.onstart(); if (this.getintent().getdata() != null) { if (this.getintent().getdata().getpath().equals("home")) { // load home activity } else if (this.getintent().getdata().getpath().equals("search")) { // load search activity } else if (this.getintent().getdata().getpath().equals("payment")) { // load payment activity } } }
Comments
Post a Comment