Je n'ai pas trouvé de réponse à cette question. J'ai une application VOIP. Je suis en mesure d'ajouter un journal sur les appels manqués dans le journal des appels natifs, mais la notification n'est pas affichée. Existe-t-il un moyen de demander au journal d'appels natif de l'appareil d'afficher la notification? Je n'aimerais pas ajouter ma propre notification car je veux être sûr que l'icône est toujours celle que l'application de journal d'appel native affichera pour les autres appels. J'ai trouvé this mais il n'y a pas de réponse. J'utilise un code similaire à celui affiché dans le post précédent.Afficher une notification pour les appels VOIP manqués
Répondre
Si vous ajoutez simplement une entrée dans le journal des appels db, la notification ne sera pas affichée. Vous devez ajouter votre notification. Si vous n'ajoutez pas votre propre notification, une notification sera affichée uniquement au démarrage du téléphone si le journal des appels est toujours là.
Juste pour plus de clarté:
Vous pouvez toujours ajouter votre propre avis, mais utilisez l'accumulation dans les icônes système Android - ce sont les mêmes icônes que l'application phonecall intégré est à l'aide. Par exemple:
Notification notification = new Notification();
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.icon = android.R.drawable.stat_notify_missed_call;
De cette façon, vous affichez toujours l'icône caractéristique de la version spécifique du système d'exploitation Android.
Pour plus d'informations, consultez le Icon Guidelines, et en particulier dans votre cas - the status bar icons.
Ceci est mon application (principalement copié à partir du code Android):
private static void showMissedCallNotification(Context context, final Contact contact) {
notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
// display the first line of the notification:
// 1 missed call: call name
// more than 1 missed call: <number of calls> + "missed calls"
int titleResId;
String expandedText;
numberMissedCalls++;
if (numberMissedCalls == 1) {
titleResId = R.string.notification_missedCallTitle;
expandedText = contact.getDisplayName();
} else {
titleResId = R.string.notification_missedCallsTitle;
expandedText = context.getString(R.string.notification_missedCallsMsg,
numberMissedCalls);
}
final PendingIntent callLogIntent = createCallLogIntent(context);
// make the notification
int id = android.R.drawable.stat_notify_missed_call;
String ticker = context.getString(R.string.notification_missedCallTicker, contact.getDisplayNumber());
long currentTime = Platform.timeProvider().getTime();
Notification note = new Notification(id, ticker, currentTime);
note.setLatestEventInfo(context, context.getText(titleResId), expandedText, callLogIntent);
note.flags |= Notification.FLAG_AUTO_CANCEL;
// This intent will be called when the notification is dismissed.
// It will take care of clearing the list of missed calls.
note.deleteIntent = createClearMissedCallsIntent(context);
//configureLedNotification(note);
notificationManager.notify(MISSED_CALL_NOTIFICATION, note);
}
/**
* Returns an intent to be invoked when the missed call notification is clicked.
* @param context
*/
private static PendingIntent createCallLogIntent(Context context) {
Intent intent = new Intent(context, ClearMissedCallsService.class);
intent.setAction(ClearMissedCallsService.ACTION_OPEN_CALL_LOGS);
return PendingIntent.getService(context, 0, intent, 0);
}
/**
* Returns an intent to be invoked when the missed call notification is cleared.
* @param context
*/
private static PendingIntent createClearMissedCallsIntent(Context context) {
Intent intent = new Intent(context, ClearMissedCallsService.class);
intent.setAction(ClearMissedCallsService.ACTION_CLEAR_MISSED_CALLS);
return PendingIntent.getService(context, 0, intent, 0);
}
/*package */ static void cancelMissedCallNotification() {
// reset the number of missed calls to 0.
numberMissedCalls = 0;
notificationManager.cancel(MISSED_CALL_NOTIFICATION);
}
et:
/**
* Handles the intent to clear the missed calls that is triggered when a notification is dismissed.
*/
public class ClearMissedCallsService extends IntentService {
/** This action is used to clear missed calls. */
public static final String ACTION_CLEAR_MISSED_CALLS = "com.android.phone.intent.CLEAR_MISSED_CALLS";
public static final String ACTION_OPEN_CALL_LOGS = "com.android.phone.intent.OPEN_CALL_LOGS";
public ClearMissedCallsService() {
super(ClearMissedCallsService.class.getSimpleName());
}
@Override
public void onCreate() {
super.onCreate();
}
@Override
protected void onHandleIntent(Intent intent) {
// Clear the list of new missed calls.
ContentValues values = new ContentValues();
values.put(Calls.NEW, 0);
StringBuilder where = new StringBuilder();
where.append(Calls.NEW);
where.append(" = 1 AND ");
where.append(Calls.TYPE);
where.append(" = ?");
getContentResolver().update(Calls.CONTENT_URI, values, where.toString(),
new String[]{ Integer.toString(Calls.MISSED_TYPE) });
NativeCallLog.cancelMissedCallNotification();
if (ACTION_OPEN_CALL_LOGS.equals(intent.getAction())) {
Intent intentOpenCallLogs = createOpenCallLogIntent();
startActivity(intentOpenCallLogs);
}
}
private static Intent createOpenCallLogIntent() {
Intent intent = new Intent(Intent.ACTION_VIEW, null);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setType("vnd.android.cursor.dir/calls");
return intent;
}
}
vous devez également ajouter ceci dans le AndroidManifest
<service android:exported="true" android:name="yourpackage.ClearMissedCallsService" > <intent-filter > <action android:name="com.android.phone.intent.CLEAR_MISSED_CALLS" /> </intent-filter> <intent-filter > <action android:name="com.android.phone.intent.OPEN_CALL_LOGS" /> </intent-filter> </service>
- 1. IPhone: Appels manqués icône
- 2. Mettre à jour la notification des appels manqués sur Android
- 3. envoyer des sms pour un appels manqués
- 4. Comment faire des appels manqués?
- 5. Puis-je utiliser Voip Pushkit Notification pour informer les utilisateurs d'autres choses qu'un appel VOiP
- 6. Android - Boutons matériels clignotants pour les appels manqués
- 7. Comment afficher uniquement les appels manqués à partir du journal des appels android
- 8. Démarrer un service dans Activité pour surveiller les appels manqués
- 9. Notification push VOIP
- 10. Asterisk - combien coûtent les appels VOIP?
- 11. Android intercepte les durées des appels VoIP
- 12. Recevoir des appels manqués dans Windows Mobile
- 13. VoIP - Appels GSM via iOS
- 14. Effacer les appels manqués à partir de la barre de notification
- 15. erreur appels manqués clairement dans android.database.SQLite
- 16. Utilisez Twilio pour les appels VoIP d'application à l'application
- 17. Définir de nouveaux appels manqués comme "vieux"
- 18. Android SIP ou webRTC uniquement pour les appels VoIP/audio?
- 19. comment faire un PhoneStateListener pour les appels VoIP
- 20. FreePBX - Notifier les appels manqués dans la file d'attente
- 21. VoIP push notification de Parse
- 22. Afficher l'interface d'appel native iOS pour les appels VoIP sortants avec CallKit
- 23. comment masquer les appels manqués à lire dans Android?
- 24. Android: notification lorsque l'utilisateur ouvre l'application SMS ou téléphone/liste des appels manqués
- 25. Envoyer un SMS pour les appels manqués seulement une fois Android Eclipse
- 26. Peut-on gérer les appels entrants en utilisant VOIP push pour twilio client?
- 27. Filtrage des appels VoIP avec tshark
- 28. Application Web PHP + Appels téléphoniques TAPI/VOIP?
- 29. Recevoir des appels avec Sipek Voip SDK
- 30. faire une application VoIP pour iPhone?