Skip to content

Commit 19a3bba

Browse files
committed
onesignal_default_sound fix
* Fixed issue where onesignal_default_sound was not used by default.
1 parent f513a8f commit 19a3bba

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public void onUnsubscribeClicked(View v) {
103103
@Override
104104
protected void onPause() {
105105
super.onPause();
106-
mHelper.dispose();
106+
if (mHelper != null)
107+
mHelper.dispose();
107108
}
108109

109110
@Override
@@ -135,7 +136,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
135136
}
136137

137138
// NotificationOpenedHandler is implemented in its own class instead of adding implements to MainActivity so we don't hold on to a reference of our first activity if it gets recreated.
138-
@OneSignal.TiedToCurrentActivity
139139
private class ExampleNotificationOpenedHandler implements NotificationOpenedHandler {
140140
/**
141141
* Callback to implement in your app to handle when a notification is opened from the Android status bar or

OneSignalSDK/onesignal/src/main/java/com/onesignal/GenerateNotification.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,10 @@ private static int getDrawableId(String name) {
660660

661661
private static Uri getCustomSound(JSONObject gcmBundle) {
662662
int soundId;
663-
String sound;
663+
String sound = null;
664664
try {
665-
sound = gcmBundle.getString("sound");
665+
if (gcmBundle.has("sound"))
666+
sound = gcmBundle.getString("sound");
666667
} catch (Throwable t) {
667668
return null;
668669
}

OneSignalSDK/onesignal/src/main/java/com/onesignal/OSUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
class OSUtils {
3636
int getDeviceType() {
3737
try {
38+
// Class only available on the FireOS and only when the following is in the AndroidManifest.xml.
39+
// <amazon:enable-feature android:name="com.amazon.device.messaging" android:required="false"/>
3840
Class.forName("com.amazon.device.messaging.ADM");
3941
return 2;
4042
} catch (ClassNotFoundException e) {

OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void init() {
154154
private static TrackGooglePurchase trackGooglePurchase;
155155
private static TrackAmazonPurchase trackAmazonPurchase;
156156

157-
public static final String VERSION = "020007";
157+
public static final String VERSION = "020008";
158158

159159
private static AdvertisingIdentifierProvider mainAdIdProvider = new AdvertisingIdProviderGPS();
160160

0 commit comments

Comments
 (0)