Skip to content

Commit b71d3cd

Browse files
authored
Merge pull request #179 from OneSignal/release_2.3.1
Release 2.3.1
2 parents 7281df6 + 8cd6679 commit b71d3cd

File tree

6 files changed

+14
-27
lines changed

6 files changed

+14
-27
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.onesignal.flutter'
2-
version '2.3.0'
2+
version '2.3.1'
33

44
buildscript {
55
repositories {

ios/Classes/OSFlutterCategories.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@
4747
- (NSDictionary *)toJson;
4848
@end
4949

50-
// TODO: Will reference the OSOutcomeEvent in OneSignal.h
51-
//@interface OSOutcomeEvent (Flutter)
52-
//- (NSDictionary *)toJson;
53-
//@end
54-
5550
@interface NSError (Flutter)
5651
- (FlutterError *)flutterError;
5752
@end

ios/Classes/OSFlutterCategories.m

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,6 @@ - (NSDictionary *)toJson {
112112
}
113113
@end
114114

115-
// TODO: Will reference the OSOutcomeEvent in OneSignal.h
116-
//@implementation OSOutcomeEvent (Flutter)
117-
//- (NSDictionary *)toJson {
118-
// NSMutableDictionary *json = [NSMutableDictionary new];
119-
//
120-
// json[@"session"] = self.session;
121-
// json[@"notification_ids"] = self.notificationIds;
122-
// json[@"name"] = self.name;
123-
// json[@"timestamp"] = self.timestamp;
124-
// json[@"weight"] = self.weight;
125-
//
126-
// return json;
127-
//}
128-
//@end
129-
130115
@implementation NSError (Flutter)
131116
- (FlutterError *)flutterError {
132117
return [FlutterError errorWithCode:[NSString stringWithFormat:@"%i", (int)self.code] message:self.localizedDescription details:nil];

ios/onesignal_flutter.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
Pod::Spec.new do |s|
55
s.name = 'onesignal_flutter'
6-
s.version = '2.3.0'
6+
s.version = '2.3.1'
77
s.summary = 'The OneSignal Flutter SDK'
88
s.description = 'Allows you to easily add OneSignal to your flutter projects, to make sending and handling push notifications easy'
99
s.homepage = 'https://www.onesignal.com'
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.source_files = 'Classes/**/*'
1414
s.public_header_files = 'Classes/**/*.h'
1515
s.dependency 'Flutter'
16-
s.dependency 'OneSignal', '2.12.1'
16+
s.dependency 'OneSignal', '2.12.2'
1717
s.ios.deployment_target = '8.0'
1818
s.static_framework = true
1919
end

lib/src/outcome_event.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,16 @@ class OSOutcomeEvent extends JSONStringRepresentable {
4646
OSSession.DISABLED;
4747

4848
// Make sure notification_ids exists
49-
this.notificationIds = outcome.containsKey("notification_ids") && outcome["notification_ids"] != null ?
50-
new List<String>.from(json.decode(outcome["notification_ids"])) :
51-
[];
49+
if (outcome.containsKey("notification_ids") && outcome["notification_ids"] != null) {
50+
if (outcome["notification_ids"] is List) {
51+
// Handle if type comes in as a List
52+
this.notificationIds = (outcome["notification_ids"] as List).map<String>((s) => s).toList();
53+
}
54+
else if (outcome["notification_ids"] is String) {
55+
// Handle if type comes in as a String
56+
this.notificationIds = new List<String>.from(json.decode(outcome["notification_ids"]));
57+
}
58+
}
5259

5360
// Make sure name exists
5461
this.name = outcome.containsKey("id") && outcome["id"] != null ?

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: onesignal_flutter
22
description: OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
3-
version: 2.3.0
3+
version: 2.3.1
44
author: Brad Hesse <[email protected]>, Josh Kasten <[email protected]>
55
homepage: https://github.com/OneSignal/OneSignal-Flutter-SDK
66

0 commit comments

Comments
 (0)