Skip to content

Commit ee7e36e

Browse files
authored
Merge pull request #44 from OneSignal/add_observers_methods
Add observers methods
2 parents 9f4cfc6 + 10e8de8 commit ee7e36e

File tree

60 files changed

+1402
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1402
-342
lines changed

Unity4.7OneSignalExample/Assets/OneSignal/Editor/OneSignalEditorScript.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.2
1+
2.3.0

0 commit comments

Comments
 (0)