简体   繁体   English

使用Mixpanel自动将通知推送到Android

[英]Using Mixpanel to push notifications to Android Automatically

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. 我想知道是否有一种方法可以从我开发的Android应用程序向设备发送推送通知。 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. 另外,如果有可能以将请求推送通知发送到特定设备的方式来开发我的php服务器。 I have already tested the SDK with my application and it receives the notification if I sent it from mixpanel.com. 我已经使用我的应用程序测试了SDK,并且如果我从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. 我读了很多有关GCM的书,似乎没有什么好的文档,无论如何都无法正常工作,而且我总是会出错。 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. Mixpanel应该可以完成这项工作,但是为了使我能够发送推送通知,我必须登录到他们的网站并使用该网站发送通知。 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. 我也尝试使用HTTP请求并将请求发送到发送推送通知的URL,但是我需要登录,但它不起作用。

Any help would be much appreciated as I have to get this application done as soon as possible! 任何帮助将不胜感激,因为我必须尽快完成此应用程序!

Thanks 谢谢

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. 您可以使Mixpanel使用“通知”功能自动发送推送通知-您不必每次都登录Mixpanel。 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. 如果要基于应用程序中的某个事件发送通知,则可以在该事件发生时将人员分析更新发送到Mixpanel。

So suppose you want people to receive a push notification to their mobile device every time they sign up in your web app. 因此,假设您希望人们每次在您的Web应用程序中注册时都会向他们的移动设备接收推送通知。 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. 然后,您可以在Mixpanel项目中使用“ Signed Up Is True”在Mixpanel中设置一个通知。 The next time you set a user to "Signed Up", they'll get a GCM notification. 下次您将用户设置为“注册”时,他们会收到GCM通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM