Android Question Help! App Rejected after publication

MrKim

Well-Known Member
Licensed User
Longtime User
My app was accepted and published. I just went back and looked and it has now been rejected. Here is the reason, below, which I simply do not understand what they mean. The app is just a phone list. When you select a number it gives you the option to call or send a text. There is also a box for email and that will open email.

Rich (BB code):
• Requested permissions do not match core functionality of the app
You declared Default SMS handler (and any other core functionality usage while default handler), Default Phone handler (and any other core functionality usage while default handler) as the core functionality of your app. However, after review, we found that your app does not match the declared use case(s). Learn more about permitted uses and exceptions.
Please either:
• Make changes to your app so that it meets the requirements of the declared core functionality or,
• Select a use case that matches your app’s functionality


I did notice that there was no line for sms
B4X:
AddPermission(android.permission.SEND_SMS)
in the manifest. It WAS there but remmed. As I recall I remmed it because Google rejected the app if the line was there!!??

I do have the code in place to request permission when they select send message.


Any help appreciated.
 

JohnC

Expert
Licensed User
Longtime User
Commented lines should not be included in the compiled app.

Sometimes certain libraries you use in your app will automatically add permissions that are not in your manifest.

On the "Log" tab of the B4A IDE, there is a "List Permissions" button, click it and post the list of permissions displayed in this thread.

This way we can get an idea of which permission(s) is causing this issue.
 
Last edited:
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
What I understand is, Google will not allow an app to send sms only.
The app must read, list, send, compose etc. i.e. do all functions of default sms to be able to send sms.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Google's reason also seems to indicate that his app is also trying to be the default "phone" app, not just the default "sms" app.

That's why I want to see the list of permissions that B4A says his package is asking for (not just whats in the manifest). Then we can get a better idea of what the full situation is.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Also, what does your app do?

Please provide a lot of details.
It's just a shared phone list. Stores name, 2 phones and email. That's it. It is designed for certain small groups to keep a phone list. You can join multiple groups but you must be "invited" to join by a member of the group. It is for a specific segment. You can't even create you own group initially. You have to send a request to me and I create the group. Currently these groups keep manual phone lists if they can get someone to do it which just seems absurd to me in this day and age so I thought I would make it easier. All I am doing, when the tap the phone # is ask: Call or Text. If they pick text it opens the default text app.

[CODE lang="b4x" title="#If B4A '8/31/21 - remmed below and removed SMS from manifest Dim CallReason As String = "In order for this program to send texts, your permission is required. The next screen will ask for that permission. If you deny permission, then this program can not start a text message for you." Dim RP As RuntimePermissions If RP.Check(RP.PERMISSION_SEND_SMS) = False Then 'if no existing phone call permission MsgboxAsync(CallReason, "Texts Permission") 'explain why this apps needs call permission Wait For MsgBox_Result (Result As Int) RP.CheckAndRequest(RP.PERMISSION_SEND_SMS) 'prompt for permission Wait For Activity_PermissionResult (Permission As String, AskResult As Boolean) If AskResult = False Then 'user did not give permission MsgboxAsync("User refused permission, cannot start texts.", "Texts Permission") Return 'abort text End If End If Dim in As Intent in.Initialize(in.ACTION_VIEW, $"sms:${Num}"$) If Msg.Length > 0 Then in.PutExtra("sms_body", Msg) StartActivity(in) #ELSE If B4i If Main.App.CanOpenUrl($"sms:"$) = False Then MP.xui.MsgboxAsync("Unable to open text app.", "Can't open sms") Else If Msg.Length > 0 Then Msg = Msg.Replace(" ", "%20") If Msg.Length > 0 Then Msg = Msg.Replace(CRLF, "%0D%0A") Num = Num.Replace(" ", "") Num = Num.Replace(CRLF, "") Main.App.OpenUrl($"sms:${Num}&body=${Msg}"$) End If #End If"] #If B4A
'8/31/21 - remmed below and removed SMS from manifest
Dim CallReason As String = "In order for this program to send texts, your permission is required. The next screen will ask for that permission. If you deny permission, then this program can not start a text message for you."
Dim RP As RuntimePermissions
If RP.Check(RP.PERMISSION_SEND_SMS) = False Then 'if no existing phone call permission
MsgboxAsync(CallReason, "Texts Permission") 'explain why this apps needs call permission
Wait For MsgBox_Result (Result As Int)
RP.CheckAndRequest(RP.PERMISSION_SEND_SMS) 'prompt for permission
Wait For Activity_PermissionResult (Permission As String, AskResult As Boolean)
If AskResult = False Then 'user did not give permission
MsgboxAsync("User refused permission, cannot start texts.", "Texts Permission")
Return 'abort text
End If
End If
Dim in As Intent
in.Initialize(in.ACTION_VIEW, $"sms:${Num}"$)
If Msg.Length > 0 Then in.PutExtra("sms_body", Msg)
StartActivity(in)

#ELSE If B4i
If Main.App.CanOpenUrl($"sms:"$) = False Then
MP.xui.MsgboxAsync("Unable to open text app.", "Can't open sms")
Else
If Msg.Length > 0 Then Msg = Msg.Replace(" ", "%20")
If Msg.Length > 0 Then Msg = Msg.Replace(CRLF, "%0D%0A")
Num = Num.Replace(" ", "")
Num = Num.Replace(CRLF, "")
Main.App.OpenUrl($"sms:${Num}&body=${Msg}"$)
End If

#End If
[/CODE]

Apple doesn't have any problem with what I am doing.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Commented lines should not be included in the compiled app.

Sometimes certain libraries you use in your app will automatically add permissions that are not in your manifest.

On the "Log" tab of the B4A IDE, there is a "List Permissions" button, click it and post the list of permissions displayed in this thread.

This way we can get an idea of which permission(s) is causing this issue.
Good idea, I forgot about that...
(is there some trick to copying the permissions list? I am unable..) Here is a screenshot.
1647855184811.png
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Google's reason also seems to indicate that his app is also trying to be the default "phone" app, not just the default "sms" app.

That's why I want to see the list of permissions that B4A says his package is asking for (not just whats in the manifest). Then we can get a better idea of what the full situation is.
I don't want to be the default phone or SMS app, all I want to do is open the default phone app with the number or start an SMS with the default app. See the code I posted. in a another message.
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
What I see, for example, SEND_SMS permission in manifest.
Now, maybe, Google reads it and blocking your app as it wants only a default sms all function app, to even have this permission,
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
to call a user using the default diailer, i use :
B4X:
Sub CallUser(mpn As String)
    #if b4a
    If (mpn.Trim.Length > 0) Then
        Private in As Intent
    
        in.Initialize(in.ACTION_VIEW,"tel:"&mpn.Trim)
        StartActivity(in)
    End If
    #else
    Private cn As String = "tel:"&removespaces(mpn.Trim)
    If mpn.Trim.Length > 0 And Main.App.CanOpenURL(cn) Then
        Main.App.OpenURL(cn)
    End If
    #end if   
End Sub
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Here is a link to sending text with an intent as will. I haven't tried this code:
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
Well below post from same thread explains, what I fear,


 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
OK, the problem looks like you are asking for permission to send an SMS using code like this:
B4X:
If RP.Check(RP.PERMISSION_SEND_SMS)

But your app is sending an SMS using an intent, so your app does NOT need to ask permission because it is calling *another* program (via the intent) to do the actual sending of the SMS.

By having the code RP.Check(RP.PERMISSION_SEND_SMS) in your app, it is forcing that permission to be added to your app which causes google to think your app wants to be the default sms app, which is not correct.

So remove all the code related to RP.Check(RP.PERMISSION_SEND_SMS) so you are no longer checking for or asking for that permission, then recompile the app and android.permission.SEND_SMS should no longer be listed in the "List Permissions" list. If it is, then you must still have code somewhere in your app that is causing this permission to be added.

You also mention that your app allows people to dial a call too, so you may need to remove any code checking/asking permission to do that in a similar way so google won't think your app is trying to be the default dialer app.
 
Last edited:
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
OK, the problem looks like you are asking for permission to send an SMS using code like this:
B4X:
If RP.Check(RP.PERMISSION_SEND_SMS)

But your app is sending an SMS using an intent, so your app does NOT need to ask permission because it is calling *another* program (via the intent) to do the actual sending of the SMS.

By having the code RP.Check(RP.PERMISSION_SEND_SMS) in your app, it is forcing that permission to be added to your app which causes google to think your app wants to be the default sms app, which is not correct.

So remove all the code related to RP.Check(RP.PERMISSION_SEND_SMS) so you are no longer checking for or asking for that permission, then recompile the app and android.permission.SEND_SMS should no longer be listed in the "List Permissions" list. If it is, then you must still have code somewhere in your app that is causing this permission to be added.

You also mention that your app allows people to dial a call too, so you may need to remove any code checking/asking permission to do that in a similar way so google won't think your app is trying to be the default dialer app.
Thank you. I was thinking the same thing last night. I will give that a try.
 
Upvote 0
Top