本文整理匯總了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);
}