Search code examples
androidfacebookpush-notificationfirebase-cloud-messagingandroid-push-notification

Is the Facebook Push Notifications feature supported by Facebook SDK version 3.23.1?


My goal is to implement the Facebook Push Notifications feature on my app. I am following the Push Campaigns Quickstart guide at https://developers.facebook.com/docs/push-notifications/quickstart. Before starting, I need to add the Facebook SDK to my app. In my build.gradle file, I have the following line:

compile 'com.facebook.android:facebook-android-sdk:3.23.1'

This means that I am using Facebook SDK version 3.23.1. That version was released on Mar 12, 2015. I was wondering if the Facebook Push Notifications feature is supported by Facebook SDK version 3.23.1. Thank you.


Solution

  • I was following the instructions at https://developers.facebook.com/docs/push-notifications/android and the following line was not letting my app to compile:

    AppEventsLogger.setPushNotificationsRegistrationId(refreshedToken);
    

    The error was what you can see at Cannot resolve method 'setPushNotificationsRegistrationId(java.lang.String)' for Facebook Push Notifications. In this link you can find the answer that applies to this question too:

    The setPushNotificationsRegistrationId() method did not exist in Facebook SDK 3.23.1: https://developers.facebook.com/docs/reference/android/3.23.1/class/AppEventsLogger/. It was introduced from Facebook SDK 4.11: https://developers.facebook.com/docs/reference/android/4.11/class/AppEventsLogger/ and https://developers.facebook.com/docs/android/change-log-4x.

    Conclusion: No, the Facebook Push Notifications feature is not supported by Facebook SDK 3.23.1. It would be required to have at least Facebook SDK 4.11.