如何关闭信号通知?

时间:2017-05-21 04:59:16

标签: android android-studio

我使用OneSignal推送通知。一切都运作良好,但我想通过切换按钮关闭通知。 如何使用。

这是代码

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    progressDialog=new ProgressDialog(this);
    progressDialog.setMessage("Yükleniyor...");
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.show();

    mWebView = (WebView) findViewById(R.id.Wview);
    mWebView.getSettings().setJavaScriptEnabled(true);
    WebSettings webSettings = mWebView.getSettings();
    webSettings.setDefaultTextEncodingName("utf-8");


    //OneSignal.setLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.DEBUG);
    // Onesignal başlıyor

   OneSignal.startInit(this)
            .inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
            .unsubscribeWhenNotificationsAreDisabled(true)
            .init();}

0 个答案:

没有答案