--- title: "Provedores múltiplos de push" slug: "multiple-push-providers" updated: 2026-06-12T10:30:51Z published: 2026-06-12T10:30:51Z canonical: "docs.xtremepush.com/multiple-push-providers" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt > Use this file to discover all available pages before exploring further. # Provedores múltiplos de push Gerencie múltiplos provedores de push em aplicações móveis Se você tem múltiplos provedores push no seu aplicativo móvel, precisa alterar levemente a integração para remover instâncias duplicadas de classes de dependência e para lidar adequadamente com as mensagens recebidas. ## Android Este guia é para aplicativos Android que usam a versão 7.2.0 e superiores do Xtremepush SDK. Adicione o seguinte ao seu arquivo manifest para remover a entrada da classe filha Xtremepush `FirebaseMessageingService` . Isso evitará qualquer conflito potencial entre os dois provedores de push. ```xml ``` Agora, dentro da sua própria classe filho FirebaseMessagingService, você precisará atualizar a `onMessageReceived` função para que ela trate as mensagens recebidas da seguinte forma: ```java @Override public void onMessageReceived(RemoteMessage remoteMessage) {    //Check if message is xpush message    if (PushConnector.isXpushMessage(this, remoteMessage)) {        //if xpush message, pass to xpush to manage        PushConnector.fcmShareRemoteMessage(this, remoteMessage);    } else {        //handle non xpush message    } } ``` Na mesma turma, você também precisará atualizar a `onNewToken` função, da seguinte forma: ```java @Override public void onNewToken(String token) {    //share the token with XPush so it is available to both providers    PushConnector.fcmShareToken(this, token);    //non xpush use of token } ``` ## iOS se você precisar verificar se uma mensagem veio do Xtremepush, para poder ignorá-la, pode fazer o seguinte: **Swift** ```swift func application(_ application: UIApplication,                     didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {    if userInfo["xpush"] != nil {        XPush.applicationDidReceiveRemoteNotification(userInfo, fetchCompletionHandler: nil)    }    // Do you our own thing if needed     } // Called when a notification is received while the app is in the foreground - (void)userNotificationCenter:(UNUserNotificationCenter *)center       willPresentNotification:(UNNotification *)notification         withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {    NSDictionary *userInfo = notification.request.content.userInfo;    if (userInfo[@"xpush"] != nil) {        // Forward XPush notifications to the SDK        [XPush userNotificationCenter:center              willPresentNotification:notification                withCompletionHandler:completionHandler];        return; // SDK calls completionHandler    }    // Handle non-XPush notifications here (if applicable)    completionHandler(UNNotificationPresentationOptionAlert); } // Called when the user taps a notification or interacts with an action button - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response         withCompletionHandler:(void (^)(void))completionHandler {    NSDictionary *userInfo = response.notification.request.content.userInfo;    if (userInfo[@"xpush"] != nil) {        // Forward XPush notifications to the SDK        [XPush userNotificationCenter:center     didReceiveNotificationResponse:response              withCompletionHandler:completionHandler];        return; // SDK calls completionHandler    }    // Handle non-XPush notification actions here (if applicable)    completionHandler(); } ``` **Objective-C** ```objectivec - (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo {    if ([userInfo objectForKey:@"xpush"] != nil) {        [XPush applicationDidReceiveRemoteNotification:userInfo fetchCompletionHandler:nil];    }    // Do you our own thing if needed } // Called when a notification is received while the app is in the foreground - (void)userNotificationCenter:(UNUserNotificationCenter *)center       willPresentNotification:(UNNotification *)notification         withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {    NSDictionary *userInfo = notification.request.content.userInfo;    if (userInfo[@"xpush"] != nil) {        // Forward XPush notifications to the SDK        [XPush userNotificationCenter:center              willPresentNotification:notification                withCompletionHandler:completionHandler];        return; // SDK calls completionHandler    }    // Handle non-XPush notifications here (if applicable)    completionHandler(UNNotificationPresentationOptionAlert); } // Called when the user taps a notification or interacts with an action button - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response         withCompletionHandler:(void (^)(void))completionHandler {    NSDictionary *userInfo = response.notification.request.content.userInfo;    if (userInfo[@"xpush"] != nil) {        // Forward XPush notifications to the SDK        [XPush userNotificationCenter:center     didReceiveNotificationResponse:response              withCompletionHandler:completionHandler];        return; // SDK calls completionHandler    }    // Handle non-XPush notification actions here (if applicable)    completionHandler(); } // Called when the user taps a notification or interacts with an action button - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response         withCompletionHandler:(void (^)(void))completionHandler {    NSDictionary *userInfo = response.notification.request.content.userInfo;    if (userInfo[@"xpush"] != nil) {        // Forward XPush notifications to the SDK        [XPush userNotificationCenter:center     didReceiveNotificationResponse:response              withCompletionHandler:completionHandler];        return; // SDK calls completionHandler    }    // Handle non-XPush notification actions here (if applicable)    completionHandler(); } ``` Se estiver usando o plugin Xtremepush Phonegap para iOS, por favor, siga o adicional [Phonegap Multiple Push Providers iOS](/documentation/docs/pt-br/phonegap-multiple-push-providers-ios)