Skip to content

Commit 2f27efa

Browse files
committed
Updated native Android OneSignal SDK to 3.6.0
* This adds support Android O and it's new Notification Categories. * Also updated to the Google Unity jar Resolver 1.2.44.0
1 parent 93f6e55 commit 2f27efa

23 files changed

+29
-665
lines changed

Unity5OneSignalExample/Assets/OneSignal/Editor/OneSignalEditorScript.cs

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ public class OneSignalEditorScriptAndroid : AssetPostprocessor {
4040
public static object svcSupport;
4141

4242
private static readonly string PluginName = "OneSignal";
43-
// If you run into conflicts OneSignal supports back to version 9.0.0.
44-
private static readonly string PLAY_SERVICES_VERSION = "10.0.+";
45-
private static readonly string ANDROID_SUPPORT_VERSION = "24.0.+";
43+
44+
// Both are set to LATEST to ensure compability between other plugins.
45+
// PLAY_SERVICES_VERSION - Tested with versions 10.2.1 to 11.2.0
46+
// ANDROID_SUPPORT_VERSION - Tested with versions 26.0.0 through 26.0.1
47+
private static readonly string PLAY_SERVICES_VERSION = "+";
48+
private static readonly string ANDROID_SUPPORT_VERSION = "+";
4649

4750
static OneSignalEditorScriptAndroid() {
4851
createOneSignalAndroidManifest();
@@ -96,22 +99,22 @@ private static void addGMSLibrary() {
9699
namedArgs: new Dictionary<string, object>() {
97100
{"packageIds", new string[] { "extra-android-m2repository" } }
98101
});
99-
100-
// Adds play-services-base, play-services-basement, play-services-iid, and support-v4 will be automaticly added.
101-
// Also adds play-services-tasks but this isn't used by OneSignal, it just added as a depency from the above.
102-
103-
104-
// Setting 8.3+ does not work with unity-jar-resolver-1.2.0 and GooglePlayGamesPlugin-0.9.34.
105-
// It creates conflicting aar files with mismatched version of 8.4 and 9.4
106-
// svcSupport.DependOn("com.google.android.gms", "play-services-gcm", "8.3+");
107-
// svcSupport.DependOn("com.google.android.gms", "play-services-location", "8.3+");
108-
// play-services-base, play-services-basement, and support-v4 will be automaticly added.
109-
// play-services-maps and play-services-measurement are not used by OneSignal
110-
// but are included as depencies from the other parts of play-services.
102+
103+
104+
Google.VersionHandler.InvokeInstanceMethod(
105+
svcSupport, "DependOn",
106+
new object[] {
107+
"com.android.support",
108+
"support-v4",
109+
ANDROID_SUPPORT_VERSION
110+
},
111+
namedArgs: new Dictionary<string, object>() {
112+
{"packageIds", new string[] { "extra-android-m2repository" } }
113+
});
111114
}
112115

113116
// Copies `AndroidManifestTemplate.xml` to `AndroidManifest.xml`
114-
// then replace `${manifestApplicationId}` with current packagename in the Unity settings.
117+
// then replace `${manifestApplicationId}` with current packagename in the Unity settings.
115118
private static void createOneSignalAndroidManifest() {
116119
string oneSignalConfigPath = "Assets/Plugins/Android/OneSignalConfig/";
117120
string manifestFullPath = oneSignalConfigPath + "AndroidManifest.xml";
@@ -125,7 +128,7 @@ private static void createOneSignalAndroidManifest() {
125128
#if UNITY_5_6_OR_NEWER
126129
body = body.Replace("${manifestApplicationId}", PlayerSettings.applicationIdentifier);
127130
#else
128-
body = body.Replace("${manifestApplicationId}", PlayerSettings.bundleIdentifier);
131+
body = body.Replace("${manifestApplicationId}", PlayerSettings.bundleIdentifier);
129132
#endif
130133
using (var streamWriter = new StreamWriter(manifestFullPath, false)) {
131134
streamWriter.Write(body);
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.3
1+
2.4.0
Binary file not shown.

Unity5OneSignalExample/Assets/PlayServicesResolver/Editor/Google.IOSResolver.dll.meta

Lines changed: 0 additions & 38 deletions
This file was deleted.
Binary file not shown.

Unity5OneSignalExample/Assets/PlayServicesResolver/Editor/Google.JarResolver.dll.meta

Lines changed: 0 additions & 38 deletions
This file was deleted.

Unity5OneSignalExample/Assets/PlayServicesResolver/Editor/Google.VersionHandler.dll.meta

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Unity5OneSignalExample/Assets/PlayServicesResolver/Editor/play-services-resolver.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)