I have an app that has been working for years, but now I want to update it to the latest android sdk. This is I have done so far. I have updated b4a to version 13.00, jdk to 19.0.2, the android sdk to 34. I use the following code to send sms:
and I get the following log:
My question is, how to do this properly?
Send sms:
beep.Initialize(300, 500) '300 milliseconds, 500 hz
Log("0")
beep.Beep
Log("1")
Dim p As PhoneSms
Log("2")
p.Send(title.SubString(title.IndexOf(":")+1),body)
Log("3")
Error log:
0
1
2
java.lang.RuntimeException: java.lang.IllegalArgumentException: com.kampfner.positionserver: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1750)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Caused by: java.lang.IllegalArgumentException: com.kampfner.positionserver: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
at android.os.Parcel.createExceptionOrNull(Parcel.java:3073)
at android.os.Parcel.createException(Parcel.java:3053)
at android.os.Parcel.readException(Parcel.java:3036)
at android.os.Parcel.readException(Parcel.java:2978)
at android.app.IActivityManager$Stub$Proxy.getIntentSenderWithFeature(IActivityManager.java:7041)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:752)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:735)
at anywheresoftware.b4a.phone.Phone$PhoneSms.Send2(Phone.java:681)
at anywheresoftware.b4a.phone.Phone$PhoneSms.Send(Phone.java:664)
at com.kampfner.positionserver.firebasemessaging$ResumableSub_fm_MessageArrived.resume(firebasemessaging.java:187)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1748)
... 8 more
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActivityManagerService.getIntentSenderWithFeatureAsApp(ActivityManagerService.java:6488)
at com.android.server.am.ActivityManagerService.getIntentSenderWithFeature(ActivityManagerService.java:6431)
at android.app.IActivityManager$Stub.onTransact$getIntentSenderWithFeature$(IActivityManager.java:11943)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3400)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3199)
My question is, how to do this properly?