iOS Question iOS Push Notification: Error 3000

Marco Iannaccone

Member
Licensed User
Longtime User
I followed, multiple times, all the steps illustrated here https://www.b4x.com/android/forum/threads/push-notifications.48562/, and also read this tread https://www.b4x.com/android/forum/threads/push-notification-error-code-3000.49883/#content, but I can't get rid of the 3000 error at application start when I try to register for push notifications.

The token can never be found.

I tried removing and regenerating all the certificates and verified that the App ID has the Push notifications enabled.

The only thing I din't try is removing the previously created App ID and create it from scratch, because it belongs to an already published app (that I intend to update with push notifications).

These are the steps I follow:
- in B4i, Tools -> Private Sign Key, compile the fields, then Create New
- in Dev Account, certificate, create Development certificate, uploading the certificate request in the keys folder, then put the generated dev certificate in the dev folder.
- enable push notifications in the App ID and generate the SSL certificate for development, then put this certificate to the keys folder.
- generate a new development provisioning profile (and I verified that it mentions the push notification service), then put this provisioning profile to the keys folder.
- in B4i, Tools -> Create Push Store-> B4X Push Server (but I think this is only needed next, by the push server...)
 

Marco Iannaccone

Member
Licensed User
Longtime User
I also tried with a separate Apple Dev Account, creating everything from scratch, with a new app ID, but I always get:
Error getting token: <B4IExceptionWrapper: Error Domain=NSCocoaErrorDomain Code=3000 "non è stata trovata nessuna stringa di autorizzazione “aps-environment” valida per l'applicazione" UserInfo={NSLocalizedDescription=non è stata trovata nessuna stringa di autorizzazione “aps-environment” valida per l'applicazione}>
 
Upvote 0

Marco Iannaccone

Member
Licensed User
Longtime User
It work after adding this string, thanx!

Now I have a different problem on the server, anyway. When trying to send a test notification from a web browser, using a string like this:
http://[HOST]:51044/send?password=[PWD]&text=Message
I don't receive any notification, and the PushServer generates this exception:


send message to
main._appstart (java line: 85)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: hex string has odd number of characters
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:471)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:442)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:516)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:131)
at b4j.example.main._appstart(main.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.main(main.java:29)
Caused by: java.lang.RuntimeException: java.lang.Exception: hex string has odd number of characters
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:462)
... 13 more
Caused by: java.lang.Exception: hex string has odd number of characters
at anywheresoftware.b4a.agraham.byteconverter.ByteConverter.HexToBytes(ByteConverter.java:254)
at b4j.example.iospush._sendmessageto(iospush.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 14 more

main.main (java line: 29)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: hex string has odd number of characters
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.main(main.java:29)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: hex string has odd number of characters
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:471)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:442)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:516)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:131)
at b4j.example.main._appstart(main.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 2 more
Caused by: java.lang.RuntimeException: java.lang.Exception: hex string has odd number of characters
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:462)
... 13 more
Caused by: java.lang.Exception: hex string has odd number of characters
at anywheresoftware.b4a.agraham.byteconverter.ByteConverter.HexToBytes(ByteConverter.java:254)
at b4j.example.iospush._sendmessageto(iospush.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 14 more

The web browser shows:
Message sent to 3 device(s).
 
Upvote 0
Top