Android-SmartWebView icon indicating copy to clipboard operation
Android-SmartWebView copied to clipboard

Shared link of my website on whastapp are not opening in smart webview

Open RahimSayyed opened this issue 6 years ago • 10 comments
trafficstars

I want to open shared link or url of my website in smart webview app. Intent popup when clicked on link but after selecting Smart webview app nothing happens further. Please help and sorry for my bad english.

RahimSayyed avatar Apr 08 '19 07:04 RahimSayyed

I'm going to assume that you've already added your intended web address in manifest data filter > host.

If the screen goes white, it probably means there is some port or file request issue, like mixture of HTTP and HTTPS requests. If not that, can you look into logs for more details of the issue.

mgks avatar Apr 25 '19 11:04 mgks

I have the same issue with WhatsApp and Telegram. When I click on my app urls in there applications, nothing happens. Here is my setting: <activity android:name="com.site.my.MainActivity" android:screenOrientation="portrait" > <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="my.site.com" android:pathPrefix="/" /> </intent-filter> The only link that application can handle from WhatsApp is "https://my.site.com/". When I click on other URLs such as "https://my.site.com/blah" nothing happens. Note that it tested the problematic URLs with my Samsung SMS app but have no problem. My android is Pie.

ATSGIT avatar Aug 18 '19 14:08 ATSGIT

Does it opens links inside apps internal browser (chrome tab) or force opens your default browser.

mgks avatar Aug 20 '19 13:08 mgks

It always tries to open such links (my.site.com) with my app. One hint, in first click on url, it seems that it tries to launch MainActivity but maybe the activity crashes and fails to load.

ATSGIT avatar Aug 26 '19 14:08 ATSGIT

@ATSGIT do you record any logs? I'd need to look into it.

mgks avatar Aug 27 '19 08:08 mgks

No, I have no log. I think the problem may relates to how the activity handles the recieved intent.

On Tue, 27 Aug 2019, 12:35 Ghazi Khan, [email protected] wrote:

@ATSGIT https://github.com/ATSGIT do you record any logs? I'd need to look into it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mgks/Android-SmartWebView/issues/86?email_source=notifications&email_token=AC7EYOPZIICLJUHIRL77XETQGTN55A5CNFSM4HEF5MC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5G4DUI#issuecomment-525189585, or mute the thread https://github.com/notifications/unsubscribe-auth/AC7EYOJ6VQDLG5SRBE5RAFDQGTN55ANCNFSM4HEF5MCQ .

ATSGIT avatar Aug 27 '19 09:08 ATSGIT

I don't know what or how to look into this, unless I have some log data. I'm not having problem on my end for the same.

Can you share the log next time you use android studio?

mgks avatar Aug 27 '19 09:08 mgks

intent filter in my app:
<activity android:name="com.xmpl.my.MainActivity" android:screenOrientation="portrait" > <!-- remove or alter as your apps requirement --> <intent-filter android:label="@string/app_name"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="my.website.com" android:pathPrefix="/" /> <!-- if you want only a specific directory from your website to be opened in the app through external links --> </intent-filter> </activity>

Logcat log on Android 7 when clicking on a link: 08-28 17:41:43.490 1590-1924/system_process I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=https://my.website.com/dashboard cmp=android/com.android.internal.app.ResolverActivity (has extras)} from uid 10009 on display 0

--------- beginning of main

08-28 17:41:43.490 1590-1664/system_process W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client 08-28 17:41:43.505 3059-3059/system:ui D/ResolverActivity: sinceTime=1565788303505 08-28 17:41:43.510 2446-2941/com.android.mms D/Mms: cancelNotification 08-28 17:41:43.515 2446-3137/com.android.mms D/Mms: cancelNotification 08-28 17:41:43.522 2446-2446/com.android.mms D/Mms: cancelNotification 08-28 17:41:43.536 1205-1264/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 7753728 08-28 17:41:43.668 2446-2446/com.android.mms W/IInputConnectionWrapper: showStatusIcon on inactive InputConnection 08-28 17:41:43.669 1205-2127/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 7753728 08-28 17:41:43.702 1590-1620/system_process I/ActivityManager: Displayed android/com.android.internal.app.ResolverActivity: +200ms (total +60s754ms) 08-28 17:41:44.733 1205-1267/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 7753728 08-28 17:41:46.462 1590-1664/system_process W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client 08-28 17:41:46.464 1590-1611/system_process I/PackageManager: Setting last chosen activity com.xmpl.my/.MainActivity for user 0: 08-28 17:41:46.464 1590-1611/system_process I/PackageManager: Action: "android.intent.action.VIEW" 08-28 17:41:46.464 1590-1611/system_process I/PackageManager: Category: "android.intent.category.DEFAULT" 08-28 17:41:46.464 1590-1611/system_process I/PackageManager: Scheme: "https" 08-28 17:41:46.464 1590-1611/system_process I/PackageManager: Authority: "my.website.com": -1 08-28 17:41:46.464 1590-1611/system_process I/PackageManager: Path: "PatternMatcher{PREFIX: /}" 08-28 17:41:46.468 1590-1924/system_process I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=https://my.website.com/dashboard flg=0x3000000 cmp=com.xmpl.my/.MainActivity (has extras)} from uid 10009 on display 0 08-28 17:41:46.971 1590-1615/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{9820d1d u0 android/com.android.internal.app.ResolverActivity t34 f} 08-28 17:41:46.975 2836-2836/com.xmpl.my V/FA: onActivityCreated 08-28 17:41:46.975 2836-2836/com.xmpl.my W/READ_PERM =: android.permission.READ_EXTERNAL_STORAGE 08-28 17:41:46.975 2836-2836/com.xmpl.my W/WRITE_PERM =: android.permission.WRITE_EXTERNAL_STORAGE 08-28 17:41:47.509 2446-2934/com.android.mms D/Mms: cancelNotification 08-28 17:41:47.512 2446-3140/com.android.mms D/Mms: cancelNotification 08-28 17:41:47.521 2446-2931/com.android.mms D/EGL_emulation: eglMakeCurrent: 0xa222b0a0: ver 2 0 08-28 17:41:47.528 3059-3059/system:ui I/Choreographer: Skipped 62 frames! The application may be doing too much work on its main thread. 08-28 17:41:47.569 1590-1931/system_process W/InputMethodManagerService: Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@26a3c5c3 (uid=10009 pid=2446) 08-28 17:41:47.671 2446-2931/com.android.mms D/EGL_emulation: eglMakeCurrent: 0xa222b0a0: ver 2 0 08-28 17:41:47.707 2446-2446/com.android.mms D/Mms: cancelNotification 08-28 17:41:48.014 2446-2942/com.android.mms D/Mms: cancelNotification 08-28 17:41:48.020 2446-3142/com.android.mms D/Mms: cancelNotification 08-28 17:41:48.023 2446-2446/com.android.mms D/Mms: cancelNotification

ATSGIT avatar Aug 28 '19 13:08 ATSGIT

I don't know what or how to look into this, unless I have some log data. I'm not having problem on my end for the same.

Can you share the log next time you use android studio?

I debugged the app and found that the problem related to the following logic in MainActivity:

		if (!isTaskRoot()) {
			finish();
			return;
		}

isTaskRoot() returns false for all external links except root url "https://www.example.com/". So when clicking on such links, the activity exits.

ATSGIT avatar Sep 16 '19 11:09 ATSGIT

I Found Solution

Uri exturi = getIntent().getData(); if(exturi!=null){ String link = exturi.toString(); aswm_view(link, false); }else{ aswm_view(ASWV_URL, false); }

natsirasrafi avatar Jan 18 '21 09:01 natsirasrafi