B4A Library Parse Library – Push Notifications and Cloud Storage

uswin4224

Member
Licensed User
Longtime User
agraham, after I implemented my code it seem to work fine if I sent a PN using JSON string , but If I send a PN using a text normal message, the app will throw out error due to unable to find an intent.

How can I catch an exception for this ? is there anyway to check whether the PN that we received is a message or a JSON script ?

need some enlightenment here. Thanks
 

uswin4224

Member
Licensed User
Longtime User
You can catch any exception with a Try / Catch block.

About the JSON string. You can check whether the string starts with a [ or {. Another option is to try to parse it and if it fails then treat it as a regular string.

I see, okay let me try this Erel.
Thanks a lot
 

bluedude

Well-Known Member
Licensed User
Longtime User
Planning to use this because of scheduled notifications

Hi agraham,

I'm planning to use parse.com because it has scheduled notifications and GCM has not. I have however a few questions about your sample:

- what is exactly the content of the message you are sending through the push notification dashboard?
- is "push_hash" a unique hash that you create when sending the message?
- do you have hands on experience with scheduled notifications? How exact on time are they?
- do we need to have a service module to run this when activity is closed?

Cheers and thanks for adding the push notifications to the library.
 

agraham

Expert
Licensed User
Longtime User
what is exactly the content of the message you are sending through the push notification dashboard?
Doesn't matter, anything.
is "push_hash" a unique hash that you create when sending the message?
No, it's part of the notification created by Parse.
do you have hands on experience with scheduled notifications? How exact on time are they?
Never tried it. Have a go yourself.
do we need to have a service module to run this when activity is closed?
No, The demo is complete and doesn't so it is not needed. The library initialises Parse which includes its own service which starts your designated activity when a notification arrives.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Just saw that scheduled is part of Pro and not the free version, no option for me currently.

Cheers,
 

Widowmaker

New Member
Licensed User
Longtime User
Push Notifications and normal notifications

Great Library, all running okay, but if I may ask (and I'm probably being a bit thick). I can see that I can control what happens when the notification is selected but can I actually control the notification.

I will be notified by the push that a sale(s) has occurred on my online shops and the amount , using channels I would want to have one alert per shop but keep track of the totakl sales, eg after 2 hours shop xxxx has had 14 sales for £325.66 sort of thing, and not a long list of 14 notifications just 1 per shop. I would need acces to notifications to update the title and text, I would also like a different sound for each shop if poss.

Hope that make sense.

Tony:sign0104:
 

Theera

Well-Known Member
Licensed User
Longtime User
Hi Agraham,
I'm just studied your library version 1.4,but when I 've download SDK of Parse,I could get only version 1.3.1 which isn't 1.2.5. I don't know that Is it work?
 

Theera

Well-Known Member
Licensed User
Longtime User
Hi Agrahm,
I 've tried already follow as readme.txt,but it's not work. please see attached picture.
 

Attachments

  • error.png
    33.5 KB · Views: 189

Theera

Well-Known Member
Licensed User
Longtime User
I've just downloaded and tried 1.3.1 and it works fine in the demo for me. Check your unfiltered logs.

Hi Agraham,
Please see my details which attached. Is there something wrong?
 

Attachments

  • showonly.png
    2 KB · Views: 175
  • ManifestFile.png
    22.1 KB · Views: 177

Theera

Well-Known Member
Licensed User
Longtime User
Hi Agraham,

After I've read (I would like to say that I'm not understand all of them,because I'm understand only short message.) I create res.xml and input info as you have shown and then set the file to be read-only. I have run again,I receive the log messages is below. Should I do continue? I'm sorry to make you tried with me.
 

Attachments

  • logfile1.png
    13 KB · Views: 168

derez

Expert
Licensed User
Longtime User
Thank you for that library, Agraham.
I followed the instructions and I got it working nicely.
I still have a question about notification -
When I send a test notification from Parse I get it but otherwise I don't get any. What triggers the notifications in the demo application ?
Edit: The test notification from parse doesn't go through notification activity.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
-
When I send a test notification from Parse I get it but otherwise I don't get any. What triggers the notifications in the demo application ?
Edit: The test notification from parse doesn't go through notification activity.
Sorry but I don't understand what you mean.
 

derez

Expert
Licensed User
Longtime User
In Notification activity there is a msgbox that should be displayed when a notification arrive:
B4X:
msg = "My Push Notification Received!" & CRLF
   msg = msg & "Channel = " & Channel & CRLF
   msg = msg & "Alert = " & Alert & CRLF
   msg = msg & "Hash = " & Hash & CRLF
   Msgbox(msg, title)
I never got one.

I enabled push in Parse and a test notification is recieved in my device when I send one from the Parse site. The question is what triggers Parse to send the notification that display the msgbox above ? or - what am I missing in the process (b4a and Parse) ?
Thanks
 
Last edited:

derez

Expert
Licensed User
Longtime User
Glad to hear that
What do I need to do to get a notification when a data item is added (for example named "Red") ?

Edit: I saw that pressing on the notification icon shows the msgbox, so this is solved for me, but the question above is still valid.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…