Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no send SMS on iOS and Android #150

Open
websystemtechnology opened this issue Mar 8, 2022 · 4 comments
Open

no send SMS on iOS and Android #150

websystemtechnology opened this issue Mar 8, 2022 · 4 comments

Comments

@websystemtechnology
Copy link

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants