@@ -40,7 +40,9 @@ public class OneSignalEditorScriptAndroid : AssetPostprocessor {
4040 public static object svcSupport ;
4141
4242 private static readonly string PluginName = "OneSignal" ;
43- private static readonly string PLAY_SERVICES_VERSION = "+" ;
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.+" ;
4446
4547 static OneSignalEditorScriptAndroid ( ) {
4648 createOneSignalAndroidManifest ( ) ;
@@ -83,10 +85,22 @@ private static void addGMSLibrary() {
8385 { "packageIds" , new string [ ] { "extra-google-m2repository" } }
8486 } ) ;
8587
88+
89+ Google . VersionHandler . InvokeInstanceMethod (
90+ svcSupport , "DependOn" ,
91+ new object [ ] {
92+ "com.android.support" ,
93+ "customtabs" ,
94+ ANDROID_SUPPORT_VERSION
95+ } ,
96+ namedArgs : new Dictionary < string , object > ( ) {
97+ { "packageIds" , new string [ ] { "extra-android-m2repository" } }
98+ } ) ;
99+
86100 // Adds play-services-base, play-services-basement, play-services-iid, and support-v4 will be automaticly added.
87101 // Also adds play-services-tasks but this isn't used by OneSignal, it just added as a depency from the above.
88-
89-
102+
103+
90104 // Setting 8.3+ does not work with unity-jar-resolver-1.2.0 and GooglePlayGamesPlugin-0.9.34.
91105 // It creates conflicting aar files with mismatched version of 8.4 and 9.4
92106 // svcSupport.DependOn("com.google.android.gms", "play-services-gcm", "8.3+");
@@ -113,8 +127,7 @@ private static void createOneSignalAndroidManifest() {
113127 #else
114128 body = body . Replace ( "${manifestApplicationId}" , PlayerSettings . bundleIdentifier ) ;
115129 #endif
116- using ( var streamWriter = new StreamWriter ( manifestFullPath , false ) )
117- {
130+ using ( var streamWriter = new StreamWriter ( manifestFullPath , false ) ) {
118131 streamWriter . Write ( body ) ;
119132 }
120133 }
0 commit comments