Skip to content

Commit 664cfac

Browse files
committed
Lowered required support library revision and geo tag fix
* No longer requires revision 23 of the Android Support Library. 22 is need for all features but an older one can be used safely. * Fixed bug where geo tag permission prompt did not work if used from the Application class on Android 6.0 * Updated example project.
1 parent fbf105a commit 664cfac

File tree

18 files changed

+206
-70
lines changed

18 files changed

+206
-70
lines changed

Examples/AndroidStudio/.idea/gradle.xml

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

Examples/AndroidStudio/app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,4 @@ dependencies {
3535
compile 'com.google.android.gms:play-services-gcm:+'
3636
compile 'com.google.android.gms:play-services-analytics:+'
3737
compile "com.google.android.gms:play-services-location:+"
38-
compile 'com.android.support:appcompat-v7:23.1.1'
3938
}

Examples/AndroidStudio/app/src/main/java/com/onesignal/example/ExampleApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public void onCreate() {
1818

1919
OneSignal.startInit(this)
2020
.setNotificationOpenedHandler(new ExampleNotificationOpenedHandler())
21+
.setAutoPromptLocation(true)
2122
.init();
2223
}
2324

Examples/AndroidStudio/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.3.0'
8+
classpath 'com.android.tools.build:gradle:1.5.0'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

OneSignalSDK.jar

4.94 KB
Binary file not shown.

OneSignalSDK/app/app.iml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@
6868
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
6969
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
7070
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
71-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
72-
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
71+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/jars" />
72+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.0.0/jars" />
73+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics/7.0.0/jars" />
74+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/7.0.0/jars" />
75+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/7.0.0/jars" />
76+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/7.0.0/jars" />
77+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/7.0.0/jars" />
7378
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
7479
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
7580
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
@@ -83,9 +88,14 @@
8388
</content>
8489
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
8590
<orderEntry type="sourceFolder" forTests="false" />
86-
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
87-
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
88-
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
91+
<orderEntry type="library" exported="" name="play-services-maps-7.0.0" level="project" />
92+
<orderEntry type="library" exported="" name="play-services-base-7.0.0" level="project" />
93+
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
94+
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
95+
<orderEntry type="library" exported="" name="play-services-location-7.0.0" level="project" />
96+
<orderEntry type="library" exported="" name="play-services-gcm-7.0.0" level="project" />
97+
<orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" />
98+
<orderEntry type="library" exported="" name="play-services-analytics-7.0.0" level="project" />
8999
<orderEntry type="module" module-name="onesignal" exported="" />
90100
</component>
91101
</module>

OneSignalSDK/app/build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,23 @@ repositories {
3535

3636
dependencies {
3737
compile fileTree(dir: 'libs', include: ['*.jar'])
38-
compile 'com.android.support:appcompat-v7:+'
38+
compile 'com.android.support:appcompat-v7:22.0.0'
3939

4040
// Use for SDK Development
41-
compile project(':onesignal')
41+
compile(project(':onesignal')) {
42+
exclude group: 'com.android.support', module: 'support-v4'
43+
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
44+
exclude group: 'com.google.android.gms', module: 'play-services-analytics'
45+
exclude group: 'com.google.android.gms', module: 'play-services-location'
46+
}
4247

4348
// Use for released SDK
4449
//compile 'com.onesignal:OneSignal:2.+@aar'
45-
//compile "com.google.android.gms:play-services-gcm:8.3.0"
46-
//compile "com.google.android.gms:play-services-analytics:8.3.0"
47-
//compile "com.google.android.gms:play-services-location:8.3.0"
48-
//compile 'com.android.support:appcompat-v7:23.1.1'
50+
51+
compile "com.google.android.gms:play-services-gcm:7.0.0"
52+
compile "com.google.android.gms:play-services-analytics:7.0.0"
53+
compile "com.google.android.gms:play-services-location:7.0.0"
54+
// compile 'com.android.support:support-v4:23.0.0'
4955

5056
// testCompile 'junit:junit:4.12'
5157
// testCompile 'org.robolectric:shadows-support-v4:3.0'

OneSignalSDK/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
android:allowBackup="true"
1313
android:icon="@drawable/ic_launcher"
1414
android:label="@string/app_name"
15-
android:theme="@style/AppTheme" >
15+
android:theme="@style/AppTheme"
16+
android:name=".OneSignalExampleApp">
1617

1718
<!--
1819
<amazon:enable-feature android:name="com.amazon.device.messaging" android:required="false"/>
@@ -72,19 +73,7 @@
7273
</activity>
7374

7475

75-
76-
77-
<activity
78-
android:name=".MainActivity2Activity"
79-
android:label="@string/title_activity_main_activity2"
80-
android:exported="false" >
81-
<!-- <intent-filter>
82-
<action android:name="com.onesignal.NotificationOpened.RECEIVE" />
83-
<category android:name="android.intent.category.DEFAULT" />
84-
</intent-filter>
85-
-->
86-
</activity>
87-
<!--
76+
<!--
8877
<receiver
8978
android:name="com.onesignal.example.TestNotificationOpenedReceiver"
9079
android:exported="false">

OneSignalSDK/app/src/main/java/com/onesignal/example/MainActivity.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,12 @@ protected void onCreate(Bundle savedInstanceState) {
5757

5858
currentActivity = this;
5959

60-
// Enable Logging below to debug issues. (LogCat level, Visual level);
61-
// OneSignal.setLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.NONE);
62-
63-
OneSignal.startInit(this)
64-
.setAutoPromptLocation(true)
65-
.setNotificationOpenedHandler(new ExampleNotificationOpenedHandler())
66-
.init();
67-
6860
OneSignal.enableInAppAlertNotification(true);
6961
OneSignal.enableNotificationsWhenActive(false);
70-
OneSignal.sendTag("test1", "test1");
62+
OneSignal.sendTag("test3", "test3");
7163
//OneSignal.setSubscription(false);
7264

65+
7366
// OneSignal.idsAvailable(new OneSignal.IdsAvailableHandler() {
7467
// @Override
7568
// public void idsAvailable(String userId, String registrationId) {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.onesignal.example;
2+
3+
import android.app.Application;
4+
5+
import com.onesignal.OneSignal;
6+
7+
public class OneSignalExampleApp extends Application {
8+
9+
@Override
10+
public void onCreate() {
11+
super.onCreate();
12+
OneSignal.setLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.NONE);
13+
OneSignal.startInit(this)
14+
.setAutoPromptLocation(true)
15+
// .setNotificationOpenedHandler(new ExampleNotificationOpenedHandler())
16+
.init();
17+
}
18+
}

0 commit comments

Comments
 (0)