Pregunta

I was wondering if there's a way to send a push notification to a device from an android application that I developed or not. Also, if it is possible to develop my php server in a way that it would request a push notification to be sent to a specific device. I have already tested the SDK with my application and it receives the notification if I sent it from mixpanel.com. I just want to make the thing automated for convenience.

I'm trying to implement an application with a messaging feature and need to notify the user that will receive the message when they receive it. I read a lot about GCM and there doesn't seem any good documentation out there and everything doesn't work no matter what and I always get errors. Mixpanel should do the job, but in order for me to be able to send push notifications, I have to be logged in to their website and use the website to send the notification. I also tried to use HTTP request and send a request to the URL that sends the push notification, but I need to be logged in and it just doesn't work.

Any help would be much appreciated as I have to get this application done as soon as possible!

Thanks

¿Fue útil?

Solución

You can get Mixpanel to send your push notifications automatically using the "Notifications" feature- you don't have to log in to Mixpanel every time. You can set up the notifications to be sent based on a user's properties. If you want to send a notification based on some event in your app, you can send a people analytics update to Mixpanel when that event occurs.

So suppose you want people to receive a push notification to their mobile device every time they sign up in your web app. On the "Thanks for signing up" page of your app, you'd put something like the following:

// Assuming you've added the Mixpanel JS snippet to your page
mixpanel.identify(SOME USER DISTINCT ID);
mixpanel.people.set("Signed Up", true);

Then, you could set up a notification in Mixpanel with "Signed Up Is True" in your Mixpanel project. The next time you set a user to "Signed Up", they'll get a GCM notification.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top