私は、Mixpanelでプッシュ通知を使用するアプリを開発しました。彼らはディープリンクを含む、うまく動作しています。Android Mixpanelプッシュ通知音付き
問題は、私の顧客が一度受信しても音が鳴りたいが、音が出ないことです。
ドキュメントを読んだあと、iOSの場合はカスタムデータにフィールドを追加するのと同じくらい簡単ですが、Androidの場合はこれをカスタマイズするためのサウンドフィールドはありません。 私は間違っていないよ場合の唯一の解決策は、Mixpanel放送受信機を拡張することですので、私はこのことから私のAndroidManifestを変更:これに
<receiver android:name="com.mixpanel.android.mpmetrics.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="my.package.name" />
</intent-filter>
</receiver>
:
<receiver android:name=".auxiliary.LocalNotificationBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="my.package.name" />
</intent-filter>
</receiver>
そして、私はこのクラスを追加しました.auxiliary.LocalNotificationBroadcastReceiver:Mixpanelから送信されたプッシュ通知がまだ正しく受信されているが、私はTHIにサウンドを追加する方法がわからない
import com.mixpanel.android.mpmetrics.GCMReceiver;
public class LocalNotificationBroadcastReceiver extends GCMReceiver {
@Override
public void onReceive(final Context context, Intent intent) {
super.onReceive(context, intent);
}
}
この方法s通知。
ご協力いただければ幸いです。