Skip to content

Commit

Permalink
Merge pull request #22 from oracle-samples/release/6.56.7
Browse files Browse the repository at this point in the history
Release 6.56.7
  • Loading branch information
neerhaj authored Jul 4, 2024
2 parents 0ef2683 + 558113b commit 72c12c0
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 155 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.56.7
- Location Support is removed in iOS


## 6.56.6
- Fixed issues related to incorrected success status of 'setNumberPreference' , 'setStringPreference' and 'registerUserId'

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

group 'com.pushio.manager.flutter'
version '6.56.6'
version '6.56.7'

buildscript {
repositories {
Expand Down
2 changes: 0 additions & 2 deletions ios/Classes/NSDictionary+PIOConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
NS_ASSUME_NONNULL_BEGIN

@interface NSDictionary(PIOConvert)
- (PIOGeoRegion *)geoRegion;
- (PIOBeaconRegion *)beaconRegion;
- (PIONotificationCategory *)notificationCategory;
- (PIOConversionEvent *)conversionEvent;
- (UIButton *)customCloseButton;
Expand Down
46 changes: 0 additions & 46 deletions ios/Classes/NSDictionary+PIOConvert.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,6 @@ - (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start le

@implementation NSDictionary(PIOConvert)

- (PIOGeoRegion *)geoRegion {
NSString *geofenceId = self[@"geofenceId"];
NSString *geofenceName = self[@"geofenceName"];
double speed = [self[@"deviceSpeed"] doubleValue];
double bearing = [self[@"deviceBearing"] doubleValue];
NSString *zoneId = self[@"zoneId"];
NSString *zoneName = self[@"zoneName"];
NSString *source = self[@"source"];
NSInteger dwellTime = [self[@"dwellTime"] integerValue];
NSDictionary *extra = self[@"extra"] ;

if(extra == nil || [extra isEqual:[NSNull null]]) {
extra = nil;
}

PIOGeoRegion *geoRegion = [[PIOGeoRegion alloc] initWithGeofenceId:geofenceId geofenceName:geofenceName speed:speed bearing:bearing source:source zoneId:zoneId zoneName:zoneName dwellTime:dwellTime extra:extra];

return geoRegion;
}

- (PIOBeaconRegion *)beaconRegion {
NSString *iBeaconUUID = self[@"iBeaconUUID"];
NSInteger iBeaconMajor = [self[@"iBeaconMajor"] integerValue];
NSInteger iBeaconMinor = [self[@"iBeaconMinor"] integerValue];
NSString *beaconId = self[@"beaconId"];
NSString *beaconName = self[@"beaconName"];
NSString *beaconTag = self[@"beaconTag"];
NSString *proximity = self[@"beaconProximity"];
NSString *zoneId = self[@"zoneId"];
NSString *zoneName = self[@"zoneName"];
NSString *source = self[@"source"];
NSInteger dwellTime = [self[@"dwellTime"] integerValue];
NSDictionary *extra = self[@"extra"];
NSString *eddyStoneId1 = self[@"eddyStoneId1"];
NSString *eddyStoneId2 = self[@"eddyStoneId2"];

if(extra == nil || [extra isEqual:[NSNull null]]) {
extra = nil;
}

PIOBeaconRegion *beaconRegion = [[PIOBeaconRegion alloc] initWithiBeaconUUID:iBeaconUUID iBeaconMajor:iBeaconMajor iBeaconMinor:iBeaconMinor beaconId:beaconId beaconName:beaconName beaconTag:beaconTag proximity:proximity source:source zoneId:zoneId zoneName:zoneName dwellTime:dwellTime extra:extra];
beaconRegion.eddyStoneId1 = eddyStoneId1;
beaconRegion.eddyStoneId2 = eddyStoneId2;

return beaconRegion;
}

- (PIONotificationCategory *)notificationCategory {
NSArray *oracleButtons = self[@"orcl_btns"];
Expand Down
93 changes: 0 additions & 93 deletions ios/Classes/PushIOManagerFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[self resetAllData:call withResult:result];
} else if ([@"isResponsysPush" isEqualToString:call.method]) {
[self isResponsysPush:call withResult:result];
} else if ([@"onGeoRegionEntered" isEqualToString:call.method]) {
[self onGeoRegionEntered:call withResult:result];
} else if ([@"onGeoRegionExited" isEqualToString:call.method]) {
[self onGeoRegionExited:call withResult:result];
} else if ([@"onBeaconRegionEntered" isEqualToString:call.method]) {
[self onBeaconRegionEntered:call withResult:result];
} else if ([@"onBeaconRegionExited" isEqualToString:call.method]) {
[self onBeaconRegionExited:call withResult:result];
} else if ([@"handleMessage" isEqualToString:call.method]) {
[self handleMessage:call withResult:result];
} else if ([@"frameworkVersion" isEqualToString:call.method]) {
Expand Down Expand Up @@ -840,91 +832,6 @@ -(void)isResponsysPush:(FlutterMethodCall *)call withResult:(FlutterResult)resul
result(@([[PushIOManager sharedInstance] isResponsysPayload:message]));
}

-(void)onGeoRegionEntered:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSDictionary *region = call.arguments;
if (region == (id)[NSNull null]) {
region = nil;
}

PIOGeoRegion *geoRegion = [region geoRegion];
NSMutableDictionary *responseDictionary = [NSMutableDictionary dictionary];
responseDictionary[@"regionType"] = @"GEOFENCE_ENTRY";
responseDictionary[@"regionID"] = geoRegion.geofenceId;

[[PushIOManager sharedInstance] didEnterGeoRegion:geoRegion completionHandler:^(NSError *error, NSString *response) {
if (error) {
result([self flutterError:error]);
} else {
result(responseDictionary);
}
}];
}


-(void)onGeoRegionExited:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSDictionary *region = call.arguments;
if (region == (id)[NSNull null]) {
region = nil;
}

PIOGeoRegion *geoRegion = [region geoRegion];
NSMutableDictionary *responseDictionary = [NSMutableDictionary dictionary];
responseDictionary[@"regionType"] = @"GEOFENCE_EXIT";
responseDictionary[@"regionID"] = geoRegion.geofenceId;

[[PushIOManager sharedInstance] didExitGeoRegion:[region geoRegion] completionHandler:^(NSError *error, NSString *response) {
if (error) {
result([self flutterError:error]);
} else {
result(responseDictionary);
}
}];
}


-(void)onBeaconRegionEntered:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSDictionary *region = call.arguments;
if (region == (id)[NSNull null]) {
region = nil;
}

PIOBeaconRegion *beaconRegion = [region beaconRegion];
NSMutableDictionary *responseDictionary = [NSMutableDictionary dictionary];
responseDictionary[@"regionType"] = @"BEACON_ENTRY";
responseDictionary[@"regionID"] = beaconRegion.beaconId;

[[PushIOManager sharedInstance] didEnterBeaconRegion:[region beaconRegion] completionHandler:^(NSError *error, NSString *response) {
if (error) {
result([self flutterError:error]);
} else {
result(responseDictionary);
}
}];
}
-(void)onBeaconRegionExited:(FlutterMethodCall *)call withResult:(FlutterResult)result {
NSDictionary *region = call.arguments;
if (region == (id)[NSNull null]) {
region = nil;
}

PIOBeaconRegion *beaconRegion = [region beaconRegion];
NSMutableDictionary *responseDictionary = [NSMutableDictionary dictionary];
responseDictionary[@"regionType"] = @"BEACON_EXIT";
responseDictionary[@"regionID"] = beaconRegion.beaconId;


[[PushIOManager sharedInstance] didExitBeaconRegion:[region beaconRegion] completionHandler:^(NSError *error, NSString *response) {
if (error) {
result([self flutterError:error]);
} else {
result(responseDictionary);
}
}];
}

- (void)setLastLocation:(CLLocation *)lastLocation {

}

-(void)handleMessage:(FlutterMethodCall *)call withResult:(FlutterResult)result {
[self sendPluginResult:result withResponse:nil andError:nil];
Expand Down
2 changes: 1 addition & 1 deletion ios/pushiomanager_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Pod::Spec.new do |s|
s.name = 'pushiomanager_flutter'
s.version = '6.56.6'
s.version = '6.56.7'
s.summary = 'Flutter Plugin for Responsys Mobile SDK'
s.description = 'Flutter Plugin for Responsys Mobile SDK'
s.homepage = 'https://github.com/oracle-samples/pushiomanager-flutter'
Expand Down
40 changes: 28 additions & 12 deletions lib/pushiomanager_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -479,29 +479,45 @@ class PushIOManager {

static Future<Map<String, String>> onGeoRegionEntered(
GeoRegion region) async {
Map<dynamic, dynamic> response =
await _channel.invokeMethod('onGeoRegionEntered', region.toJson());
return response.cast<String, String>();
if (Platform.isAndroid) {
Map<dynamic, dynamic> response =
await _channel.invokeMethod('onGeoRegionEntered', region.toJson());
return response.cast<String, String>();
} else {
throw PlatformException(code: "API not supported");
}
}

static Future<Map<String, String>> onGeoRegionExited(GeoRegion region) async {
Map<dynamic, dynamic> response =
await _channel.invokeMethod('onGeoRegionExited', region.toJson());
return response.cast<String, String>();
if (Platform.isAndroid) {
Map<dynamic, dynamic> response =
await _channel.invokeMethod('onGeoRegionExited', region.toJson());
return response.cast<String, String>();
} else {
throw PlatformException(code: "API not supported");
}
}

static Future<Map<String, String>> onBeaconRegionEntered(
BeaconRegion region) async {
Map<dynamic, dynamic> response =
await _channel.invokeMethod('onBeaconRegionEntered', region.toJson());
return response.cast<String, String>();
if (Platform.isAndroid) {
Map<dynamic, dynamic> response =
await _channel.invokeMethod('onBeaconRegionEntered', region.toJson());
return response.cast<String, String>();
} else {
throw PlatformException(code: "API not supported");
}
}

static Future<Map<String, String>> onBeaconRegionExited(
BeaconRegion region) async {
Map<dynamic, dynamic> response =
await (_channel.invokeMethod('onBeaconRegionExited', region.toJson()));
return response.cast<String, String>();
if (Platform.isAndroid) {
Map<dynamic, dynamic> response = await (_channel.invokeMethod(
'onBeaconRegionExited', region.toJson()));
return response.cast<String, String>();
} else {
throw PlatformException(code: "API not supported");
}
}

static Future<bool?> getExecuteRsysWebUrl() async {
Expand Down

0 comments on commit 72c12c0

Please sign in to comment.