今週カップルのバインディングライブラリを使用してIntercomIO SDKをXamarin.Formsアプリに追加しましたが、現在はプッシュ通知を取得しようとしていますが、私はMainHctivityのPushHandlerService.Register(これ)を呼び出すと、この呼び出しのまわりでtry catchブロックによってキャッチされていないクラスcom.google.android.gms.gcm.GcmReceiverが見つからないというアプリケーションのクラッシュが発生します。XamarinのAndroidでプッシュ通知をIntercomIOと一緒に登録できません
ここでは、Androidでプッシュ通知を設定するMainActivity内のメソッドです。
public void registerForPushNotifications()
{
try
{
GcmClient.CheckDevice(this);
GcmClient.CheckManifest(this);
//Register the app for push notifications.
PushHandlerService.Initialize(this);
//if (!GcmClient.IsRegistered(this))//Temporarily force the app to register for push notifications
{
System.Diagnostics.Debug.WriteLine("Registering");
// Register for GCM
PushHandlerService.Register(this);
}
LocalBroadcastManager lbc = LocalBroadcastManager.GetInstance(this);
PushActionReceiver rec = new PushActionReceiver(this);
lbc.RegisterReceiver(rec, new IntentFilter("pushaction"));
}
catch (Java.Net.MalformedURLException)
{
var e = new Exception("There was an error creating the Mobile Service. Verify the URL");
System.Diagnostics.Debug.Fail(String.Format(@"Exception at {0}: {1}", this.GetType().Name, e.Message));
Insights.Report(e);
}
catch (Exception e)
{
System.Diagnostics.Debug.Fail(String.Format(@"Exception at {0}: {1}", this.GetType().Name, e.Message));
if (e.GetType() != typeof(TaskCanceledException))
Insights.Report(e);
}
}
とマニフェストで
は私がPushHandlerService.Register(this)を呼び出していない時に問題が発生しませんが、その後明らかに、私はできませんインターホン<receiver android:name="io.intercom.android.sdk.gcm.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"></receiver>
ための受信機の定義を追加しましたプッシュ通知をもう受信する(私たちのシステムからのものを含む)
ここでは何が起こっているのですか?ライブラリと依存関係は正しく設定されていますが、GcmReceiverクラスを見つけることができないようです。
私たちのGCMのセットアップが何らかの理由とFCMに基づいて新しいものを(作成した後に非協力的だった、それが今日仕事を得ることができました)期待どおりに動作し始めました。 – zezioen