liumingxing / titanium_module_jpush_android Goto Github PK
View Code? Open in Web Editor NEW极光推送的module,针对Android平台
License: Other
极光推送的module,针对Android平台
License: Other
你好,根据Readme写了个大概的demo,可是按按钮准备订阅时系统提示了如下错误 (Ti SDK 5.0.4), 不知道应该如何修改?
[ERROR] : JPush: [AndroidUtil] No target service !
[WARN] : JPush: [AndroidUtil] AndroidManifest.xml missing required service: cn.jpush.android.service.DaemonService
[ERROR] : JPush: [AndroidUtil] The permission should be defined - com.my.package.permission.JPUSH_MESSAGE
[WARN] : JPush: [AndroidUtil] You should make main activity extends InstrumentedActivity (JPush), otherwise you will not see user click and user active time start on report in Portal.
我只在controller里面添加了一个按按钮订阅的事件,没有写处理点击的事件
$.registerJPushBtn.addEventListener("click",function(){
push.setAlias(Ti.App.Properties.getString("userid", "test12345"), function(e){
Ti.API.log("register to jpush code: " + e.code + ", token: " + e.device_token);
});
});
Tiapp.xml里面添加的配置如下,基本就是复制了readme里面的内容然后改了几个包名和Appkey:
<service android:enabled="true" android:exported="false" android:name="cn.jpush.android.service.PushService">
<intent-filter>
<action android:name="cn.jpush.android.intent.REGISTER"/>
<action android:name="cn.jpush.android.intent.REPORT"/>
<action android:name="cn.jpush.android.intent.PushService"/>
<action android:name="cn.jpush.android.intent.PUSH_TIME"/>
</intent-filter>
</service>
<receiver android:enabled="true" android:name="cn.jpush.android.service.PushReceiver">
<intent-filter android:priority="1000">
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY"/>
<category android:name="com.my.package"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.USER_PRESENT"/>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
<receiver android:name="com.mamashai.jpush.MamashaiReceiver">
<intent-filter>
<action android:name="cn.jpush.android.intent.REGISTRATION"/>
<action android:name="cn.jpush.android.intent.UNREGISTRATION"/>
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED"/>
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED"/>
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED"/>
<action android:name="cn.jpush.android.intent.ACTION_RICHPUSH_CALLBACK"/>
<action android:name="cn.jpush.android.intent.CONNECTION"/>
<category android:name="com.my.package"/>
</intent-filter>
</receiver>
<activity
android:configChanges="orientation|keyboardHidden"
android:name="cn.jpush.android.ui.PushActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="cn.jpush.android.ui.PushActivity"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="com.my.package"/>
</intent-filter>
</activity>
<service android:enabled="true" android:exported="false" android:name="cn.jpush.android.service.DownloadService"/>
<receiver android:name="cn.jpush.android.service.AlarmReceiver"/>
<meta-data android:name="JPUSH_CHANNEL" android:value="google-play"/>
<meta-data android:name="JPUSH_APPKEY" android:value="myappkey"/>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.