parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Store push notification history / status

Open sakinasugra opened this issue 10 years ago • 21 comments

I have migrated my parse app successfully to locally setup parse server. I am able to register the device installation and also am able to send pushes from my device to other devices. But the pushes that I send are not saved either on the parse dashboard under push nor in my mognodb in _PushStatus. I am using iOS and below is the code that I have used:

              `NSString *post = [NSString stringWithFormat:@"{\"where\": {\"channels\": \"%@\"},\"data\": {\"action\": \"LOGOUT\",\"content-available\": \"1\",\"moduleIdentifier\":\"LOGOUT\",\"nTitle\":\"Password Changed\"}}",@"My_channel"];

                NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

                NSURL *url = [NSURL URLWithString:@"https://my_localhost_url/parse/push/"];

                NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];

                [request setHTTPMethod:@"POST"];

                [request addValue:@"My_App_Id" forHTTPHeaderField:@"X-Parse-Application-Id"];

                [request addValue:@"My_Master_Key" forHTTPHeaderField:@"X-Parse-Master-Key"];

                [request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

                [request setHTTPBody:postData];

                NSURLResponse *requestResponse;

                NSError *err;

                NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&requestResponse error:&err];`

sakinasugra avatar Feb 22 '16 15:02 sakinasugra

@sakinasugra there is no tracking of the push sending yet, PR are welcome

flovilmart avatar Feb 22 '16 17:02 flovilmart

@gfosco was there an API / url scheme that was in place before?

flovilmart avatar Feb 22 '16 21:02 flovilmart

@sakinasugra can you give the columns/types of _PushStatus?

flovilmart avatar Feb 22 '16 21:02 flovilmart

Is this what you guys @flovilmart @gfosco are talking about? Where is this data stored its not in Core, im assuming this is another internal db for push in the parse.com system?

image

gateway avatar Feb 22 '16 22:02 gateway

That's what we're talking about. I'm not sure they are migrated when migrating an app. There is maybe more to do here than just scratching the surface of storing the push request results. That also implies that push adapter implement a common callback for the push server response

flovilmart avatar Feb 22 '16 23:02 flovilmart

@flovilmart I would guess this data could be stored in a _Push class however it would be good for someone at parse @gfosco could maybe shed some light on what the schema might look like, also when a user clicks on a text message how do we know when its open, does iOS send something back to parse incrementing a counter?

gateway avatar Feb 23 '16 01:02 gateway

That Would be The analytics that are unimplemented as of now ;)

flovilmart avatar Feb 23 '16 02:02 flovilmart

@flovilmart when I send a push from the parse website, the push is displayed on the parse website and also in my migrated database ( see the images) screen shot 2016-02-23 at 10 40 38 am screen shot 2016-02-23 at 10 42 43 am

but when I send the push from my ios app using my code, it does not get logged, neither in the parse website nor my migrated database but I receive the notification. Is this not implemented yet or I have gone wrong somewhere??

sakinasugra avatar Feb 23 '16 05:02 sakinasugra

It hasn't been implemented yet. PRs welcome :)

drew-gross avatar Feb 23 '16 06:02 drew-gross

Thank You.

sakinasugra avatar Feb 23 '16 06:02 sakinasugra

@drew-gross I would like to try to take this on

JohnMorales avatar Feb 25 '16 16:02 JohnMorales

@JohnMorales stay tuned for the spec !

flovilmart avatar Feb 25 '16 16:02 flovilmart

@flovilmart Sounds good,

On a side note is there a gitter, irc, or slack channel where direction and ideas are discussed? I don't seem to find anywhere discussing how to communicate w/ the project lead and interested parties beyond reading through comments on issues

JohnMorales avatar Feb 25 '16 17:02 JohnMorales

We're setting that up!

flovilmart avatar Feb 25 '16 17:02 flovilmart

@JohnMorales we've uploaded a Gist with the spec for the _PushStatus class here https://gist.github.com/flovilmart/bf64276507d685ae41f6.

Let me know if there are implementation details you're not sure about.

The work will likely to be in the src/Controllers/PushController.js and we'll need to add a callback/method to the PushAdapters to get the status of the sent pushes.

For now, don't worry about all the adapters, we can start by having something functional with ParsePushAdapter.js

Good luck and Thanks!

flovilmart avatar Feb 25 '16 17:02 flovilmart

:+1: for Slack channel

gateway avatar Feb 25 '16 17:02 gateway

@gateway :+1: for the nick

JohnMorales avatar Feb 25 '16 18:02 JohnMorales

@JohnMorales did you make any progress on that?

flovilmart avatar Mar 12 '16 02:03 flovilmart

Sorry man, I was trying to figure out the overall architecture and was a bit overwhelmed. It might make more sense for me to pick up something where I can look at a similar task as a guide.

On Fri, Mar 11, 2016 at 9:17 PM, Florent Vilmart [email protected] wrote:

@JohnMorales https://github.com/JohnMorales did you make any progress on that?

— Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/parse-server/issues/566#issuecomment-195637423 .

JohnMorales avatar Mar 12 '16 02:03 JohnMorales

No big deal! Was just to know! This a kinda a tricky one is we wanna have delivery etc...

flovilmart avatar Mar 12 '16 04:03 flovilmart