Sub FinishDownload
Log(">>> FinishDownload")
'Activity.RemoveAllViews
'Activity.LoadLayout("2")
WebView1.LoadHtml("<html><script>function SMS(){window.location.href='sms:0012127773456';}</script><body onload=SMS(); > or click <a href='sms:0012127773456'>SMS</a></body></html>")
'WebViewExtras1.addWebChromeClient(WebView1, "")
End Sub
Seems that there is no app installed on your device which has registered the scheme sms://
I´m wondering why you want to send a sms from a webview if you already have ALL YOU NEED in the Phone lib of b4a...
B4X:
Dim Sms1 As PhoneSms
Sms1.Send(phone number,"hello")
1. i have primary Java app with third party SDK's (to do audio/video/presentation/logmein etc etc)
2. I need secondary app to trigger URLScheme to my primary APP. (not only SMS service to use)
If i am not wrong. In past it worked with Cordova even. Not sure how to do it in B4A.
You are free to define a new scheme (and your app responsible for this scheme)... Like myscheme://blabla
Any link with the scheme myscheme:// will be starting your app. You app need to read the parameters and parse them...
You are free to define a new scheme (and your app responsible for this scheme)... Like myscheme://blabla
Any link with the scheme myscheme:// will be starting your app. You app need to read the parameters and parse them...
Compile and install serviceapp first. It registers the schemes...
Quit the app
Compile and run wvapp. A wv with a html page from assets is shown. Click on any of the links to open the service app
- when i use your sample (works). But when i use your "wvapp.zip" to trigger mine/third party SDK apps similar way, then it still fail like before
- To execute my/third party (closed source) SDK.
when i use following RAW method (without using WebView, WebViewExtra) it do work too
B4X:
Sub callPrimaryApp
Dim Intent1 As Intent
' works : "closedsourcesdk://arg0_arg1_arg2/"
' works : "closedsourcesdk://arg0_arg1_arg2"
Intent1.Initialize(Intent1.ACTION_VIEW, "closedsourcesdk://arg0_arg1_arg2")
StartActivity(Intent1)
End Sub
The problem seems to be in the scheme parts.
Compare it to real URLs to a domain giving some vars.
For example
Register a scheme
"closedsource"
which is responsible for the domain "sdk".
You then can handle all links to "closedsource://sdk/*
For ex:
closedsource://sdk/arg0/arg1/arg
The app reacts on closedsource://sdk
Everything from the Query (in this case /arg0/arg1/arg) you need to parse yourself. BUT you can use as many parameters you want. You just need to be able to parse it in the main app....