本文整理汇总了Java中cn.jpush.android.api.JPushInterface.setPushNotificationBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java JPushInterface.setPushNotificationBuilder方法的具体用法?Java JPushInterface.setPushNotificationBuilder怎么用?Java JPushInterface.setPushNotificationBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.jpush.android.api.JPushInterface
的用法示例。
在下文中一共展示了JPushInterface.setPushNotificationBuilder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStyleBasic
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
/**
* 设置通知提示方式 - 基础属性
*/
private void setStyleBasic() {
BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(PushSetActivity.this);
builder.statusBarDrawable = R.drawable.ic_launcher;
builder.notificationFlags = Notification.FLAG_AUTO_CANCEL; //设置为点击后自动消失
builder.notificationDefaults = Notification.DEFAULT_SOUND; //设置为铃声( Notification.DEFAULT_SOUND)或者震动( Notification.DEFAULT_VIBRATE)
JPushInterface.setPushNotificationBuilder(1, builder);
Toast.makeText(PushSetActivity.this, "Basic Builder - 1", Toast.LENGTH_SHORT).show();
}
示例2: setStyleCustom
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
/**
* 设置通知栏样式 - 定义通知栏Layout
*/
private void setStyleCustom() {
CustomPushNotificationBuilder builder = new CustomPushNotificationBuilder(PushSetActivity.this, R.layout.customer_notitfication_layout, R.id.icon, R.id.title, R.id.text);
builder.layoutIconDrawable = R.drawable.ic_launcher;
builder.developerArg0 = "developerArg2";
JPushInterface.setPushNotificationBuilder(2, builder);
Toast.makeText(PushSetActivity.this, "Custom Builder - 2", Toast.LENGTH_SHORT).show();
}
示例3: setAddActionsStyle
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
private void setAddActionsStyle() {
MultiActionsNotificationBuilder builder = new MultiActionsNotificationBuilder(PushSetActivity.this);
builder.addJPushAction(R.drawable.jpush_ic_richpush_actionbar_back, "first", "my_extra1");
builder.addJPushAction(R.drawable.jpush_ic_richpush_actionbar_back, "second", "my_extra2");
builder.addJPushAction(R.drawable.jpush_ic_richpush_actionbar_back, "third", "my_extra3");
JPushInterface.setPushNotificationBuilder(10, builder);
Toast.makeText(PushSetActivity.this, "AddActions Builder - 10", Toast.LENGTH_SHORT).show();
}
示例4: setBasicPushNotificationBuilder
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
/**
* 自定义通知行为,声音、震动、呼吸灯等。
*/
public static void setBasicPushNotificationBuilder(JSONArray data,
CallbackContext callbackContext) {
BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(NXTPushPlugin.getActivity());
builder.developerArg0 = "Basic builder 1";
JPushInterface.setPushNotificationBuilder(1, builder);
JSONObject obj = new JSONObject();
try {
obj.put("id", 1);
} catch (JSONException e) {
e.printStackTrace();
}
}
示例5: setStyleBasic
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
/**
*设置通知提示方式 - 基础属性
*/
private void setStyleBasic(){
BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(PushSetActivity.this);
builder.statusBarDrawable = R.drawable.ic_launcher;
builder.notificationFlags = Notification.FLAG_AUTO_CANCEL; //设置为点击后自动消失
builder.notificationDefaults = Notification.DEFAULT_SOUND; //设置为铃声( Notification.DEFAULT_SOUND)或者震动( Notification.DEFAULT_VIBRATE)
JPushInterface.setPushNotificationBuilder(1, builder);
Toast.makeText(PushSetActivity.this, "Basic Builder - 1", Toast.LENGTH_SHORT).show();
}
示例6: setStyleCustom
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
/**
*设置通知栏样式 - 定义通知栏Layout
*/
private void setStyleCustom(){
CustomPushNotificationBuilder builder = new CustomPushNotificationBuilder(PushSetActivity.this,R.layout.customer_notitfication_layout,R.id.icon, R.id.title, R.id.text);
builder.layoutIconDrawable = R.drawable.ic_launcher;
builder.developerArg0 = "developerArg2";
JPushInterface.setPushNotificationBuilder(2, builder);
Toast.makeText(PushSetActivity.this,"Custom Builder - 2", Toast.LENGTH_SHORT).show();
}
示例7: init
import cn.jpush.android.api.JPushInterface; //导入方法依赖的package包/类
/**
* @param isDebug
*/
public void init(boolean isDebug) {
JPushInterface.setDebugMode(isDebug);
JPushInterface.init(mContext);
JPushInterface.setLatestNotifactionNumber(mContext, LASTEST_NOTIFICATION_NUMBER);
BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(mContext);
builder.notificationFlags = Notification.FLAG_AUTO_CANCEL;
builder.notificationDefaults = Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE;
builder.developerArg0 = "data";
JPushInterface.setPushNotificationBuilder(1, builder);
}