iOS Question Push Notifications Problem

tufanv

Expert
Licensed User
Longtime User
Hello,

I have a problem implmenting push notifications for ios

1)Is b4x push server server have to run 24/7 or when just sending a notification?
2) I am receving an error uploading token error. The server ip and port is entered correctly

for the server side :

I could not understand what :
#same password as the password set in B4i key settings:
iPushKeystorePassword=123456

means for b4x push server. I used my private sign key for the development mode but i am not sure



edit: I tried the default private sign key i dont know if i did correct but when i send the mesage send requet i get
Message sent to 0 devices

btw after i run the server from b4j logs show:

B4X:
Program started.
2015-11-30 15:35:21.334:INFO::main: Logging initialized @692ms
2015-11-30 15:35:21.376:INFO:oejs.Server:main: jetty-9.1.z-SNAPSHOT
2015-11-30 15:35:21.387:WARN:oejh.MimeTypes:main: java.util.MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale en_US
2015-11-30 15:35:21.392:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@35851384{/,file:/C:/PushServer/Objects/www,AVAILABLE}
2015-11-30 15:35:21.394:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\PushServer\Objects\logs\b4j-2015_11_30.request.log
2015-11-30 15:35:21.435:INFO:oejs.ServerConnector:main: Started ServerConnector@180bc464{HTTP/1.1}{0.0.0.0:51044}
2015-11-30 15:35:21.435:INFO:oejs.Server:main: Started @806ms
Emulated network latency: 100ms
server version: 0.95
server is listening on port: 51044
Socket connected.
Feedback Socket connected.
feedback terminated

and when i try to send msg to devices ( which says sent to 0 devices ) i dont get anything from the logs from b4j nothing happens

when i check the logs from the txt file under logs directory i can see the requests i think

B4X:
:39:24 +0000] "GET /send?password=xxx&text=deneme%20deneme HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36"
192.168.0.100 -  -  [30/Nov/2015:13:40:36 +0000] "GET /send?password=xxx&text=deneme%20deneme HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36"

also in b4i app debug mode: I see error uplaoding token
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1)Is b4x push server server have to run 24/7 or when just sending a notification?
The push server should run 24/7 to allow the devices to send the tokens whenever the iOS app is started.

I am receving an error uploading token error. The server ip and port is entered correctly
This means that the device wasn't able to send the token to the server.
Make sure that the relevant port is open in Windows firewall.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
The push server should run 24/7 to allow the devices to send the tokens whenever the iOS app is started.


This means that the device wasn't able to send the token to the server.
Make sure that the relevant port is open in Windows firewall.

I added the ports manually to windows firewall but still the same issue. Are the things I wrote in first post shows that everything should work normally ? Also am i right about the private sign key issue ?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I fixed the problem. I am suing a vps now. Token uploaded successfuly and when i use message send I got message sent to 1 devices. But i couldnt get a notification while my app is on background .

I am using web browser to navigate to

http://myserver:51044/send?password=passwrod&text=deneme
to send the msg it says sent to 1 devices but cant get anytthing on my phone
 
Last edited:
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Have you killed the app with a swipe? If yes then it will not receive notifications until you start it again.
No i just pressed the home button and got back to main screen. I gave permission to notifications also.
( I am using private sign key of development mode in config of server for push keystore password can there be a problem for that ? )
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Make sure to test it in release mode.

The notification should show when the app is in the background. Recheck the permissions.
I uninstalled the app reinstalled it give permission again. Runed the app pressed home button and send the msg. Now it send to 2 devices in the logs.
But i never receive any msg altugh the app is in background and in release mode.

I also installed release mode on 3 more edvices and now i get
Message sent to 5 device(s).

but nothing appears on devices :/
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…