-1

I was reading https://github.com/urbanairship/android-library and I found this:

dependencies {
    ...
    // Urban Airship SDK - FCM
    implementation 'com.urbanairship.android:urbanairship-fcm:9.7.1'
}

In the sample project at https://github.com/urbanairship/android-library, they are using this:

dependencies {
    ...
    // Urban Airship - FCM
    implementation project(':urbanairship-fcm')
    ...
}

I was expecting the sample project to have implementation 'com.urbanairship.android:urbanairship-fcm:9.7.1' and not implementation project(':urbanairship-fcm'). Is 'project(:urbanairship-fcm') referring to a folder that contains the urbanairship-fcm library/code? Is it referring to this folder?: https://github.com/urbanairship/android-library/tree/master/urbanairship-fcm

Thank you.

UPDATE 1: Basically, I am familiar with this syntax: implementation 'com.urbanairship.android:urbanairship-fcm:9.7.1'. I am not familiar with this syntax: implementation project(':urbanairship-fcm'). If I understand it correctly, implementation project(':urbanairship-fcm') means that there is a folder called urbanairship-fcm that contains the source code with the com.urbanairship.android:urbanairship-fcm library. Is that correct?

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103

2 Answers2

2

When you see implementation project(':urbanairship-fcm') that means it's pulling it from a local module instead of remote package. The sample is setup to use the library source so we can use the sample app to test our development changes.

ralepinski
  • 1,756
  • 8
  • 15
  • Thank you Ralepinski. Wouldn't have been better to use in https://github.com/urbanairship/android-library, something like this?: `implementation 'com.urbanairship.android:urbanairship-fcm:9.7.1'`. I wonder what version of Airship `implementation project(':urbanairship-fcm')` is using. Hopefully not an old version, since I wanted to test my project using Version 9.7.1, one of the latest versions available today, if not the latest. – Jaime Montoya May 14 '19 at 16:53
  • 1
    If you are pulling from the repo, its always using the latest release - https://github.com/urbanairship/android-library/blob/master/CHANGELOG.md#version-971---march-14-2019. Version 9.7.1 is the latest. – ralepinski May 14 '19 at 17:08
  • Awesome! Thanks. – Jaime Montoya May 14 '19 at 17:16
-1

The sample project at https://github.com/urbanairship/android-library/tree/master/sample is outdated. For example, the Autopilot at https://github.com/urbanairship/android-library/blob/master/sample/src/main/java/com/urbanairship/sample/SampleAutopilot.java was last updated on Jan 29, 2018. It does not incorporate the following code that Airship mentions at https://docs.airship.com/platform/android/getting-started/#sdk-installation:

// Android O
  if (Build.VERSION.SDK_INT >= 26) {
      Context context = UAirship.getApplicationContext();
      NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

      NotificationChannel channel = new NotificationChannel("customChannel",
              context.getString(R.string.custom_channel_name,
              NotificationManager.IMPORTANCE_DEFAULT);

      notificationManager.createNotificationChannel(channel);
  }

So I better contacted Airship support to request an updated version of the sample project or a follow-up because I cannot use a sample project that is extremely old as a reference. In fact, looking at https://github.com/urbanairship/android-library/blob/master/CHANGELOG.md, on January 28, 2019, the latest Urban Airship SDK available back then was "Version 8.9.7 - January 22, 2018". I do not see how that project could incorporate the latest google-services, play-services and Firebase versions available today.

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103
  • The sample project is current and works fine. The UA SDK defines a default channel, so you do not have it defined. I see how the documentation is confusing around that so I will update it. – ralepinski May 14 '19 at 16:17