2016-05-11 3 views

答えて

7

NotificationExtenderServiceクラスをセットアップし、AndroidManifest.xmlに追加する必要があります。Serviceです。

import com.onesignal.OSNotificationPayload; 
import com.onesignal.NotificationExtenderService; 

public class NotificationExtenderBareBonesExample extends NotificationExtenderService { 
    @Override 
    protected boolean onNotificationProcessing(OSNotificationReceivedResult receivedResult) { 
     // Read properties from result. 

     // Returning true tells the OneSignal SDK you have processed the notification and not to display it's own. 
     return true; 
    } 
} 

AndroidManifest.xml

<service 
    android:name=".NotificationExtenderBareBonesExample" 
    android:permission="android.permission.BIND_JOB_SERVICE" 
    android:exported="false"> 
    <intent-filter> 
     <action android:name="com.onesignal.NotificationExtender" /> 
    </intent-filter> 
</service> 

詳細はOneSignalアンドロイドBackground Data and Notification Overridingマニュアルを参照してください。

+0

Tnx @jkastenこれは私を助けてくれました。 Onesignalダッシュボードでキーと値のペアに必要なパラメータを送信できるとの考えを伝えました。 – Majstor

+0

@Majstorあなたはコードを提供してもいいですか?どのように私たちは通知を隠すことができますか? –

+0

@KarandeepAtwal私の答えは3.0 SDKで利用できるものに更新されました。 アンドロイド:許可=「android.permission.BIND_JOB_SERVICE」のAndroidオレオのため – jkasten

関連する問題