Other B4X Push Server

marcick

Well-Known Member
Licensed User
Longtime User
For the B4i app you need to set the #ProvisionFile attribute to point to the push provision profile.

I'm investigation where is my problem because everythings works ok in sandbox, but I have continuous "trying to reconnect" (and doesn't work) in production.
Which would be the "push provisioning profile" ?
Is it a normal AppSTore or AdHoc with a non wildcard ID, correct ?
 

marcick

Well-Known Member
Licensed User
Longtime User
Yes, it works perfect in sandbox. Just have this problem changing the config.txt for production.
I'm reading all the threads to understand where I'm wrong.
 

marcick

Well-Known Member
Licensed User
Longtime User
Deleted everything (certificates, provisioning and keystore) and restarted from scratch.
Now it works........
 

kohle

Active Member
Licensed User
Longtime User
Hi,

I have question about the config.txt file of the pushserver.

I made a release jar file. When I put it on an other computer, I need to
1) put the config.txt and push.keystore too ?
2) Is there a need to copy other libs too ?
3) Is it better to put the passwords and keys into the script, for security reason ?

I'm not familiar with java programming.
 

marcick

Well-Known Member
Licensed User
Longtime User
Hi
1) yes
2) no
3) It is supposed the server is your. Once somebody has acces to your server the problem is not to grab that data ....
 

kohle

Active Member
Licensed User
Longtime User
Thanks for the response.

3)

I made an app on android with notification service for a friends company, all works fine,
mysql + php scripts on my webhoster server, notifications via php script and so on.

Than I was asked for building the app for apple.
I did the same like in android, added a type os in the database table and an other
script sending the notification.

Dont work with apple, because apple use a comunication port which my hosting plan dont support.

So I took from the pushserver script only the communication parts to apple, and get
the Ids from my webserver, deleting unused ids and so on. Like I do with android. Everything works fine.

I made a windows Software with the old, but still good, "b4ppc Desktop" to send notifications
via http/request and php script to android and via jar to apple.

So the jar script runs on a local computer at my friends place. That why I dont want to put special passwords/keys in a readable file.
 

marcick

Well-Known Member
Licensed User
Longtime User
ok, you always can take those parameter out of that file and write them encrypted in another file
 

Richard Goh

Active Member
Licensed User
Longtime User
I am testing on the push server and client. But I got below error when trying to send messages to my device.
The error is refer to getIdForName. How can I get/know the device name to use to sent message to my device?

java -cp b4a_gcm.jar anywheresoftware.b4a.c2dm.C2DM send GT-I9082 "Testing message"
java.lang.RuntimeException: java.net.ConnectException: Connection refused: conne
ct
at anywheresoftware.b4a.c2dm.C2DM.getIdForName(C2DM.java:98)
at anywheresoftware.b4a.c2dm.C2DM.sendMessageTo(C2DM.java:48)
at anywheresoftware.b4a.c2dm.C2DM.main(C2DM.java:218)
 

Richard Goh

Active Member
Licensed User
Longtime User
Hi Erel,
Sorry, used a wrong testing program to test. I had managed to setup the server and client. It's working fine now.
Thanks for your efforts and great job.
 

cloner7801

Active Member
Licensed User
Longtime User
When I started the b4x project it logs :



what i should do?
 

Attachments

  • upload_2016-6-7_19-23-21.png
    34 KB · Views: 364

Erel

B4X founder
Staff member
Licensed User
Longtime User
See the code in the Send module.

This is the most important line:
B4X:
Dim rows As List = DBUtils.ExecuteMemoryTable(Main.db, _
     "SELECT token, type FROM tokens WHERE updated_time > ? ORDER BY updated_time DESC", _
     Array As String (DateTime.Now - DAYS_LIMIT * DateTime.TicksPerDay), 0)
You can modify it as you need and get only a specific token. Or you can just put the token in the request and then create a List with this token.
 

mrjaw

Active Member
Licensed User
Longtime User
One question:
Using B4X Server Push , I dont need to use Google and all API google anymore to send notifications to Android and IOs?
This server can run into a VPS running Linux, not GUI ?

Thks
 

Darren69

Member
Licensed User
Longtime User
Hi Erel,

Is there a way to manually look at the database contents? I know I have some bad iOS tokens in my database, I just compiled the latest version of the Pushserver and it used the feedback service to remove all the bad tokens, but now when I send a push notification where as before i moved to version 0.97 of push server I had 252 messages sent, now 0 are sent and the database file has gone from being 57k to 1k so I have a feeling my database file is now empty - if possible I would like to manually delete the bad keys as I took a note of them.

thanks

Darren
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
now 0 are sent and the database file has gone from being 57k to 1k so I have a feeling my database file is now empty
Note that the database is made of three files, so the size can be misleading.

The database is a regular SQLite database. You can use SQLite Manager plug-in for Firefox or any other tool that can open such databases.
 

karyadi

Member
Licensed User
Longtime User
Hi all,

i try example using ios, b4j apps running ok.
but when i run B4i-PushClient it show error :

Error getting token: <B4IExceptionWrapper: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo={NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}>

what is wrong with that?
when i try use
B4X:
        Dim bc As ByteConverter
        Dim j As HttpJob
        j.Initialize("j", Me)
        j.PostString(ServerUrl & "/devicetoken", "token=" & bc.HexFromBytes(Token) & "&type=1")

it's show blank token.

and i try "http://192.168.88.36:51044/send?password=123&text=tes2" in browser
it's show "Message sent to 1 device(s)."
but nothing show on my iphone.

please help me.
thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…