Android Question Problem - Sending emails with Gmail REST API

Tempomaster

Active Member
Licensed User
Longtime User
Hello,

my problem relates to this thread:

https://www.b4x.com/android/forum/threads/b4x-sending-emails-with-gmail-rest-api.81736

This variant for sending eMails actually works great. But now I have got a problem, which I probably can not solve myself.

I want to use this code now for my Tempomaster app. The package name is:

gd.tempomaster_pro

This will give me a mistake from Google (see screenshot). I'm afraid the underscore is causing problems. Can you do something there. I can not change the package name anymore.

Best regards,
Gunnar
 

Attachments

  • Screenshot_20180912-225815_Chrome.jpg
    Screenshot_20180912-225815_Chrome.jpg
    170.1 KB · Views: 197

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Tempomaster

Active Member
Licensed User
Longtime User
Hello Erel,

I first made the change in the manifest editor:

B4X:
<data android:scheme="gd.tempomaster_pro" />

That alone has not solved the problem yet. The underscore is obviously not accepted. I deleted the underscore in the entry (of course also in the Google API Console):

B4X:
<data android:scheme="gd.tempomasterpro" />

I've made the following changes to the GoogleOAuth2.bas file:

B4X:
#if B4A
        'packageName = Application.PackageName
        packageName = "gd.tempomasterpro"

B4X:
Private Sub IsNewOAuth2Intent(Intent As Intent) As Boolean
    Return Intent.IsInitialized And Intent <> LastIntent And Intent.Action = Intent.ACTION_VIEW And _
        Intent.GetData <> Null And Intent.GetData.StartsWith("gd.tempomasterpro")   '(Application.PackageName)
End Sub

That's how it works.

I thank you for your help. She has led me on the right track. B4a would not be half as good without the help of you and the many other users here in the forum. I would have stuck my head in the sand so many times.

Best regards,
Gunnar
 
Upvote 0

Tempomaster

Active Member
Licensed User
Longtime User
I apologize. I added the function to send the email in 2018. I haven't bothered with it since. I tested the function again earlier. It works perfectly.

Erel always helped me with problems like this. I think he'll tell you right away why this isn't working for you. I installed Android 13 on my test device.

Best regards,
Gunnar
 
Upvote 0
Top