2017-10-22 3 views
0

私は私のアプリでアンドロイドローカル通知を使用しています、すべてが 、正常に動作しますが、私の質問は次のとおりです。xamarinはどのように特定のユーザーにローカル通知を送信したり、表示/非表示を行うことができますか?

は、特定のユーザーまたはグループに通知を送信する方法はありますか、表示/への通知を非表示/特定からユーザーですか?

NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
    .SetAutoCancel(true)     // Dismiss the notification from the notification area when the user clicks on it 
    .SetContentIntent(resultPendingIntent) // Start up this activity when the user clicks the intent. 
    .SetContentTitle("Button Clicked")  // Set the title 
    .SetNumber(count)      // Display the count in the Content Info 
    .SetSound(RingtoneManager.GetDefaultUri(RingtoneType.Alarm)) 
    .SetDefaults(0) 
    .SetSmallIcon(Resource.Drawable.notify) 
    .SetVibrate(new long[] { 1000, 1000 }) 
    .SetContentText(String.Format("The button has been clicked {0} times.", count)); // the message to display. 

// Finally, publish the notification: 
NotificationManager notificationManager = (NotificationManager)GetSystemService(Context.NotificationService); 
      notificationManager.Notify(ButtonClickNotificationId, builder.Build()); 
+0

?あなたは遠隔通知について話していますか? – SushiHangover

+0

いいえ、ローカル通知 – citysoft

+0

あなたのユーザ/グループ条件に 'if'文を実行して、最初に通知を作成しないでください;-) – SushiHangover

答えて

0

特定のユーザーまたはグループに通知を送信する方法はありますか、表示/に/特定のユーザーからの通知を非表示にするには?

あなたはあなたのアプリケーションは、アプリケーションがプラットフォームの鍵で署名しなければならないことを意味signature|systemののProtectionLevelを持っているMANAGE_USERS許可を、必要とする、ユーザーを照会するUserManagerを使用する必要がありますが、それを使用します。 this caseを参照できます。

関連する問題