B4A Library Parse Library – Push Notifications and Cloud Storage

derez

Expert
Licensed User
Longtime User
Edit: Sorry Sorry Sorry - found the problem, I forgot to enable push notifications in Parse.com
Now read the rest...because it works and it is not in the example.


Hi
There is a ParsePush object in the library which should send push notifications from the application.
I wrote the following definitions:
B4X:
 If FirstTime Then
      Parse.SetLoggingLevel(2) ' Verbose logging for testing only - remove for a real application
      Parse.TrackOpening   
      Parse.EnableNotifications(Notification)
      Parse.Subscribe("Channel1", Notification)
      GPS.Initialize("GPS")
      pofix.Initialize("Location")
      
      push.Initialize
      push.SetChannel("Channel1")
      push.SetMessage(name & " Updated Location")
  End If
and later there is
B4X:
push.Send("push",2)

This is in according to what the tutorial instruct:
ParsePush push = new ParsePush();
push.setChannel("Giants");
push.setMessage("The Giants just scored! It's now 2-2 against the Mets.");
push.sendInBackground();

The push is reported as success in Sub push_DoneSend but the PN is not recieved by the application.
In the Parse.com I have the attached report on push notifications, while the problem is that it was sent to 0 subscribers.
I thought maybe it sends to all but the initializing app, so I checked with two devices, but no.
What is wrong ?
 

Attachments

  • 1.png
    34.1 KB · Views: 181
  • 2.png
    12.8 KB · Views: 182
Last edited:

urikupfer

Member
Licensed User
Longtime User
Hi Agraham
Is there a way to add the ProgressCallback function for getting the progress
of uploads and downloads of big files.
They have this option in the android api.
Uri Kupfer
 

Widowmaker

New Member
Licensed User
Longtime User
Nobody answered me...:sign0148:
I originally asked:


Having looked into it there does not seem to be a way to control the push notification so I thought I would just control the message , but am I likely to get 1 PN for every alert or will the system combine them the way the ordinary notifications work, so if the phone has not been looked at for a while will it say blahblah app with 6 as the number of total PN's or will it trigger 6 separate PN's in the notifications area, if the first scenario is the case when my activity is resumed by the user when they touch the notification how do I combine all the data from all 6 PN's

thanks in advance if i'm asking silly stuff, I can program honest but sometimes I need a push to go in the right direction.:BangHead:
 

derez

Expert
Licensed User
Longtime User
Widowmaker
I'm learning this myself so this answer is by no means an expert answer...
Every notificatation sent by an application (=shop) will be recieved separately, I don't see a way to combine them. You can put the name of the shop in the push.setmessage and so you'll have the name of the sending shop in the text of the notification.
 

Widowmaker

New Member
Licensed User
Longtime User
thanks for replying, i found that out as well, shame really, it would be nice if i could interact before the user selects it, but as you say this is not possible, if i do it another way and get the info from the parse db when they select the pn it will just be pointless cos they could still have loads of pn's to click, if i could cancel the pn's i could at least create my own, but that is not possible either afaik.

if i could get into the parse library code i could make it do what i want, is that possible or is the source scrambled.
 

hookshy

Well-Known Member
Licensed User
Longtime User
Could you add an example on how to send PN from device using parsepush object ?
I don't understand how to use taskId , please explain.
Thanks
 

mading1309

Member
Licensed User
Longtime User
First of all thanks that to write this useful lib and make it public.
I want change or extend the GCM service of google with the Parse Push service.
GCM referenced to a service not activity. Is the notification in the status bar the reason for the activity?

From the demonstration application is I exchange the activity Notification and want use my one one.
For the first step I just renamed the activity to >>MyOne<<.
After renaming I receive an error message

"Module Notification not found"

Seems the activity name notification is "hard coded".
The subscribe method and the methods for enable and disable notification comes with an parameter.
I guess this parameter might reference to the class shall be called in case a push message arrived.

Now there are questions:

1) The notification in the status bar is a must with this library? I need to receive the Information send by the push service in the background and in a silent way. My application checks the received data and decide what to do.
2) The parameter of the method subscribe reference and for disable and enable the notification the same. Is it a must for this wrapper library and what use are these parameters?
3) Does the Parse.com push service make use of any Google services comes with the Playstore similar Google push service?
4) To subscribe the push service, is it a must to reference to an activity? Can it be a service also? At least the required type is class. I cannot give a try because receiving a push message the activity Notification is called and not myone. What I've done wrong?

thanks for some answers and help

Mading
 

boten

Active Member
Licensed User
Longtime User
Why is data1 & data 2 (from RES.XML) displayed on the log, whatever SetLoggingLevel I use, or not use at all?
Anybody who is using my app and looking a the log will be able to manipulate the app on Parse.
 

holdemadvantage

Active Member
Licensed User
Longtime User
Why is data1 & data 2 (from RES.XML) displayed on the log, whatever SetLoggingLevel I use, or not use at all?
Anybody who is using my app and looking a the log will be able to manipulate the app on Parse.

sorry i don't understand, what do you mean with "anybody will be able to manipulate my app on parse"? To send a push you have to log into your account? let me know ty
 

boten

Active Member
Licensed User
Longtime User
I'm not talking about push.
If a user runs my B4A-app on a rooted device they can see the log, hence my keys to parse, hence they can write an app to manipulate my data.
 

msawada

Member
Licensed User
Longtime User
Hi agraham, as usual I love your libraries. Great work! I do have a question regarding whether or not you have plans to add the saveEventually() method or if it is somehow already in this library.
Thanks Mike
 

mickeyk600

Member
Licensed User
Longtime User
Hello Agraham ,
I have been testing your parse Library the last few days and it is fantastic and easy to use – Thanks

One important methods is missing: Sending Push notification via Json. If you Look at the parse Site under send Push notification,
You will see that they allow sending Push notification via json , this allows creating a custom intent that will be fired at the receiving side of the push notification and we ( the app developers) will be able to intercept it and provide our app a custom behavior, when the notification arrives.
I envision 2 methods : SetMessage(text) SetMessage2(json) the 2nd one that takes Json and allow sending anything (if we omit the “alert” and “title” the notification will not show on the notification tray, sometime it is needed)
From Parse documentation:
From parse:
*****************************************************************************
action: (Android only) the Intent should be fired when the push is received. If not title or alert values are specified, the Intent will be fired but no notification will appear to the user.
**************************************************************************************

What do you think?
Thanks in advance
Mickey
 

boten

Active Member
Licensed User
Longtime User
Is there a way to get the Analytics information on Parse using the Parse Lib?
I'm interested in "retrieving" the number of API requests, Push notifications and App Opens by dates.
This info can be seen in Dashboard/Analytics but how can I get this info into my app (possibly by some query)?
 

boten

Active Member
Licensed User
Longtime User
ParseQuery.Limit=-1 does not work, retrieves only 100.

ParseQuery.Limit=1000000 will retrieve more than 100 (of course up to 1 million)

Edit:
Max retrieved results is 1000 (Parse documentation).
A query.Skip (query method) is "missing" from the parse lib

Skip is described in the Parse documentaion as:
Skips a number of results before returning. This is useful for pagination of large queries

If my class contains over 1000 results that should be retrieved, there is no way to get them all if Skip is not implemented in the library.
 
Last edited:

BowTieNeck

Member
Licensed User
Longtime User
First, thanks for a great library. It worked first time for me, very clear instructions.
I'd like my users to have the option to not receive notifications so I've created a Settings Activity where they can select a radio button to choose whether or not they get notifications.
To switch off notifications I've tried Parse.Unsubscribe("Channel1") and Parse.DisableNotifications followed by Parse.Unsubscribe("Channel1") but neither way seems to work.
I'm obviously missing something. What is it?
Thanks,
Chris
 

clarionero

Active Member
Licensed User
Longtime User
Hi. The last version of library is 1.4 but if i open the XML file it say version 1.2. Which is wrong?

Thanks

Rubén
 

touchsquid

Active Member
Licensed User
Longtime User
I love the work agraham does. The parse library is excellent, but seems to be missing the ParseUser object which I need for my app. Any chance that could be added?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…