Using Jpush Aurora push to achieve real-time capture user log to seven Cow Cloud server. MD

Source: Internet
Author: User

# #场景 # #

Our app often appears unusual for a particular user's phone (note that not all users, specific users of a particular model) if the UF Alliance, so many log you can not finish, you can not see the log can not solve the problem. So the question is, how to implement a specific user to fetch the log in real time, such as I want the user ID of **lixiaodaoaaa** This user's log information? (Users do not know that we want to catch her log, you can do something evil) to send a notification to him, and received the notification, the device can do nothing to prompt, can do something evil, but I think it's OK. (his log.) Our default log will be saved in a specific directory using Logutils. # #解决方法 # # First we know that Aurora push can send a custom message to a specific device implementation specific user, then why can not send a push message to the specified user, when the user received the message (when the user received the message, we do not know, we quietly processing), upload files to seven cow cloud server it? # #操作方法 # # Depending on the device name, we can get the device alias when the Jpush is initialized, we send this notification # #代码里去处理一下 # # * * Create a custom message that may not necessarily create a notification, the user may not know that he received the message, But our program can know what to do when you receive a message * * * * *
  if (JPushInterface.ACTION_REGISTRATION_ID.equals (Intent.getaction ())) {
String Regid = bundle.getstring (jpushinterface.extra_registration_id);
LOG.D (TAG, "[Jpushreceiver] Receive registration Id:" + regid);

} else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals (Intent.getaction ())) {
LOG.D (TAG, "[Jpushreceiver] receives a push down custom message:" + bundle.getstring (jpushinterface.extra_message));
String pushmsg = bundle.getstring (jpushinterface.extra_message);
if (Pushmsg.contains ("upload")) {
LogFile = logutils.getlogfile (context);
if (LogFile = = null) return;
Uploadlogtoqiniucloud (Context,logfile);
Return
}
if (Stringutils.isempty (pushmsg)) {
Return
}
Createcustomernotification (context, pushmsg);
`

# #然后去看下七牛空间吧 # #

# #这样子, when you want to get the data, just send a notification to this user. It's OK. #

Using Jpush Aurora push to achieve real-time capture user log to seven Cow Cloud server. MD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.