gluonhq / gluonfx-gradle-plugin

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects
BSD 3-Clause "New" or "Revised" License
100 stars 22 forks source link

no send SMS on iOS and Android #150

Open websystemtechnology opened 2 years ago

websystemtechnology commented 2 years ago

Attached are the logs with both iOS and Android errors that I get when I try to send a sms in my project

sendSMS.txt

jperedadnr commented 2 years ago

Provide a way to identify the issue, details about your settings (GluonFX plugin version, GraalVM version, JDK version, Gluon Attach version...), and at least a code snippet with how you send the SMS.

Extract the main part of the exceptions from the log and post it on the issue.

Did it work before, and if it did, when started failing?

websystemtechnology commented 2 years ago

Until now I used the plugin browser to send SMS on Android version; In the last version of Attach the cose check the protocl url accepting only htto or httos. I post the detail; In the previus version of Gluon Moblie plugin 3.8 the Android code is this: @Override public void launchExternalBrowser(String url) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplication().startActivity(browserIntent); }

while now in the lasta version of Attach Browser is:

if (!url.startsWith("http://") && !url.startsWith("https://")) { Log.e(TAG, "Invalid URL: url should start with http:// or https://"); return false; }

    if (debug) {
        Log.v(TAG, "Launching URL: " + url);
    }
    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    if (browserIntent.resolveActivity(activity.getPackageManager()) == null) {
        Log.e(TAG, "There is no activity to handle the browser intent");
        return false;
    }

    browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    activity.startActivity(browserIntent);
websystemtechnology commented 2 years ago

Provide a way to identify the issue, details about your settings (GluonFX plugin version, GraalVM version, JDK version, Gluon Attach version...), and at least a code snippet with how you send the SMS.

Extract the main part of the exceptions from the log and post it on the issue.

Did it work before, and if it did, when started failing?

The error in sending sms is still present. What can I do?

websystemtechnology commented 1 year ago

For Android usage ? You can remove this "if check"; class com.gluonhq.helloandroid.DalvikBrowserService line 53 if (!url.startsWith("http://") && !url.startsWith("https://")) { Log.e(TAG, "Invalid URL: url should start with http:// or https://"); return false; } removing this check I can send sms using this url: smsto://, or open other protocol; Can you modify this attach or do you think is better create a new attach?