Skip to content

Commit

Permalink
Merge pull request #179 from OneSignal/release_2.3.1
Browse files Browse the repository at this point in the history
Release 2.3.1
  • Loading branch information
mikechoch authored Dec 5, 2019
2 parents 7281df6 + 8cd6679 commit b71d3cd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 27 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.onesignal.flutter'
version '2.3.0'
version '2.3.1'

buildscript {
repositories {
Expand Down
5 changes: 0 additions & 5 deletions ios/Classes/OSFlutterCategories.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
- (NSDictionary *)toJson;
@end

// TODO: Will reference the OSOutcomeEvent in OneSignal.h
//@interface OSOutcomeEvent (Flutter)
//- (NSDictionary *)toJson;
//@end

@interface NSError (Flutter)
- (FlutterError *)flutterError;
@end
Expand Down
15 changes: 0 additions & 15 deletions ios/Classes/OSFlutterCategories.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,6 @@ - (NSDictionary *)toJson {
}
@end

// TODO: Will reference the OSOutcomeEvent in OneSignal.h
//@implementation OSOutcomeEvent (Flutter)
//- (NSDictionary *)toJson {
// NSMutableDictionary *json = [NSMutableDictionary new];
//
// json[@"session"] = self.session;
// json[@"notification_ids"] = self.notificationIds;
// json[@"name"] = self.name;
// json[@"timestamp"] = self.timestamp;
// json[@"weight"] = self.weight;
//
// return json;
//}
//@end

@implementation NSError (Flutter)
- (FlutterError *)flutterError {
return [FlutterError errorWithCode:[NSString stringWithFormat:@"%i", (int)self.code] message:self.localizedDescription details:nil];
Expand Down
4 changes: 2 additions & 2 deletions ios/onesignal_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
Pod::Spec.new do |s|
s.name = 'onesignal_flutter'
s.version = '2.3.0'
s.version = '2.3.1'
s.summary = 'The OneSignal Flutter SDK'
s.description = 'Allows you to easily add OneSignal to your flutter projects, to make sending and handling push notifications easy'
s.homepage = 'https://www.onesignal.com'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'OneSignal', '2.12.1'
s.dependency 'OneSignal', '2.12.2'
s.ios.deployment_target = '8.0'
s.static_framework = true
end
13 changes: 10 additions & 3 deletions lib/src/outcome_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@ class OSOutcomeEvent extends JSONStringRepresentable {
OSSession.DISABLED;

// Make sure notification_ids exists
this.notificationIds = outcome.containsKey("notification_ids") && outcome["notification_ids"] != null ?
new List<String>.from(json.decode(outcome["notification_ids"])) :
[];
if (outcome.containsKey("notification_ids") && outcome["notification_ids"] != null) {
if (outcome["notification_ids"] is List) {
// Handle if type comes in as a List
this.notificationIds = (outcome["notification_ids"] as List).map<String>((s) => s).toList();
}
else if (outcome["notification_ids"] is String) {
// Handle if type comes in as a String
this.notificationIds = new List<String>.from(json.decode(outcome["notification_ids"]));
}
}

// Make sure name exists
this.name = outcome.containsKey("id") && outcome["id"] != null ?
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: onesignal_flutter
description: OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
version: 2.3.0
version: 2.3.1
author: Brad Hesse <brad@onesignal.com>, Josh Kasten <josh@onesignal.com>
homepage: https://github.com/OneSignal/OneSignal-Flutter-SDK

Expand Down

0 comments on commit b71d3cd

Please sign in to comment.