# #场景 # #
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