Skip to content

Commit

Permalink
Merge pull request #96 from OneSignal/release-5.1.1
Browse files Browse the repository at this point in the history
Release 5.1.1
  • Loading branch information
emawby authored Mar 7, 2024
2 parents 07ac579 + 403a42f commit bff21e5
Show file tree
Hide file tree
Showing 82 changed files with 915 additions and 463 deletions.
Binary file modified OneSignalSDK.DotNet.Android.Core.Binding/Jars/core-release.aar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ typedef void (^OSDialogActionCompletion)(int tappedActionIndex);
@end

@interface OSDialogInstanceManager : NSObject
+ (void)setSharedInstance:(NSObject<OSDialogPresenter> *_Nonnull)instance;
+ (void)setSharedOSDialogInstance:(NSObject<OSDialogPresenter> *_Nonnull)instance;
+ (NSObject<OSDialogPresenter> *_Nullable)sharedInstance;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,12 @@
#ifndef OneSignalClient_h
#define OneSignalClient_h

typedef void (^OSDataRequestSuccessBlock)(NSData *data);

typedef void (^OSMultipleCompletionBlock)(NSDictionary *responses);
typedef void (^OSMultipleFailureBlock)(NSDictionary<NSString *, NSError *> *errors);
typedef void (^OSMultipleSuccessBlock)(NSDictionary<NSString *, NSDictionary *> *results);

@interface OneSignalClient : NSObject
+ (OneSignalClient *)sharedClient;
@protocol IOneSignalClient <NSObject>
- (void)executeRequest:(OneSignalRequest *)request onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;
- (void)executeSynchronousRequest:(OneSignalRequest *)request onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;

// ie. for loading HTML or other non-JSON based requests
- (void)executeDataRequest:(OneSignalRequest *)request onSuccess:(OSDataRequestSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;

// Executes multiple OneSignalRequest's simultaneously, needs a unique identifier for each request
- (void)executeSimultaneousRequests:(NSDictionary<NSString *, OneSignalRequest *> *)requests withSuccess:(OSMultipleSuccessBlock)successBlock onFailure:(OSMultipleFailureBlock)failureBlock;

/*
TODO: We want to eventually migrate over to using this method for executing simultaneous requests:
This allows us to combine multiple async concurrent requests to return from a single callback with the proper formatted responses from each reuqest (successful or not, account for params returning from GETs).
A generalized format should be followed and we should make sure not to break form that as it could break peoples apps in the future if we add params and remove params from this callback.
Currently for the only implementation this is used for "setExternalUserId:withCOmpletion:" the format is as follows:
NSDictionary response = @{
(required) @"push" : {
@"success" : @(true) or @(false)
},
(optional) @"email" : {
@"success" : @(true) or @(false)
}
}
@end

Building off of this format now will require:
1. Including other attributes and whether they are required or not
ex. @"push" is always going to be within the callback resposne (required), meanwhile,
@"email" will not always exist in the callback resposne (optoinal)
2. Can't remove params that are required as an app may be expecting them and removing/modifying a key could break there app with an SDK upgrade
3. Add more requirements...
*/
- (void)executeSimultaneousRequests:(NSDictionary<NSString *, OneSignalRequest *> *)requests withCompletion:(OSMultipleCompletionBlock)completionBlock;
@interface OneSignalClient : NSObject <IOneSignalClient>
+ (OneSignalClient *)sharedClient;
@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// "*" in comment line ending comment means the string value has not been changed
// App

#define ONESIGNAL_VERSION @"050100"
#define ONESIGNAL_VERSION @"050103"

#define OSUD_APP_ID @"GT_APP_ID" // * OSUD_APP_ID
#define OSUD_REGISTERED_WITH_APPLE @"GT_REGISTERED_WITH_APPLE" // * OSUD_REGISTERED_WITH_APPLE
Expand Down Expand Up @@ -255,6 +255,9 @@ typedef enum {GET, POST, HEAD, PUT, DELETE, OPTIONS, CONNECT, TRACE, PATCH} HTTP

// Defines the maximum delay time for confirmed deliveries
#define MAX_CONF_DELIVERY_DELAY 25.0

// Flush interval for operation repo in milliseconds
#define POLL_INTERVAL_MS 5000
#else
// Test defines for API Client
#define REATTEMPT_DELAY 0.004
Expand All @@ -272,6 +275,9 @@ typedef enum {GET, POST, HEAD, PUT, DELETE, OPTIONS, CONNECT, TRACE, PATCH} HTTP
// We don't want to delay confirmed deliveries in unit tests
#define MAX_CONF_DELIVERY_DELAY 0

// Reduce flush interval for operation repo in tests
#define POLL_INTERVAL_MS 100

#endif

// A max timeout for a request, which might include multiple reattempts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@
#import <OneSignalCore/OneSignalWrapper.h>
#import <OneSignalCore/OSInAppMessages.h>
#import <OneSignalCore/OSLocation.h>

// TODO: Testing: Should this class be defined in this file?
@interface OneSignalCoreImpl : NSObject

+ (void)setSharedClient:(nonnull id<IOneSignalClient>)client;
+ (nonnull id<IOneSignalClient>)sharedClient;

@end
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</data>
<key>Headers/OSDialogInstanceManager.h</key>
<data>
e5mWq3a0PQfTjU5ei4329nYUfwc=
0cqPhE4ouuhTrKXfHIJkRW2Wj98=
</data>
<key>Headers/OSInAppMessages.h</key>
<data>
Expand Down Expand Up @@ -74,19 +74,19 @@
</data>
<key>Headers/OneSignalClient.h</key>
<data>
xP3ln1gkiz3rYTGL3cLbXxIleq4=
2U/hJ9DbKlsx3Cvrnb2gD3aEgL4=
</data>
<key>Headers/OneSignalCommonDefines.h</key>
<data>
ndR/xLw4L1jcYInpPlfRn0Qag08=
9+DseJsRuluL4on4TDShqzwG724=
</data>
<key>Headers/OneSignalConfigManager.h</key>
<data>
rs5am2kldk0oFRiHVIRnYiOwwfk=
</data>
<key>Headers/OneSignalCore.h</key>
<data>
fEHoz2bZp9TOWw+VERtj2wWR2p4=
A5diIhe11EigU1EdavSdpYTXdmA=
</data>
<key>Headers/OneSignalCoreHelper.h</key>
<data>
Expand Down Expand Up @@ -167,7 +167,7 @@
<dict>
<key>hash2</key>
<data>
TZyL4I0k2RDNt3IPxABcOPcjrjywMJ0x1SZXMXeiqxA=
Xi9ng0MWuNxky8LclThg6wlOCpltBy4ksR2hWWxT55Y=
</data>
</dict>
<key>Headers/OSInAppMessages.h</key>
Expand Down Expand Up @@ -258,14 +258,14 @@
<dict>
<key>hash2</key>
<data>
CSAZbyxJ1QBEtH5JYy/HwJiYsj+udPG1u4dhMFgkUtQ=
bZZ7bNHZy8Mym+UeVjwRL9HtlIxmmTNomVrGmmHcw2A=
</data>
</dict>
<key>Headers/OneSignalCommonDefines.h</key>
<dict>
<key>hash2</key>
<data>
jFVB6mq//2WLhfivs+XsCMKTED1ORLn5oxnpRIvdLbc=
Cq6IxW/DiUZubnyD/5/WSvbP+O5Y8RiYYaFm33SbGW0=
</data>
</dict>
<key>Headers/OneSignalConfigManager.h</key>
Expand All @@ -279,7 +279,7 @@
<dict>
<key>hash2</key>
<data>
CZNtCCWsZDtT4qPjBwdved+ePMTZHxOiPePJe2wbheY=
bNJqZIbqxv7lhnk5ArffKSp7Y82rYzXbvscXeyors2M=
</data>
</dict>
<key>Headers/OneSignalCoreHelper.h</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ typedef void (^OSDialogActionCompletion)(int tappedActionIndex);
@end

@interface OSDialogInstanceManager : NSObject
+ (void)setSharedInstance:(NSObject<OSDialogPresenter> *_Nonnull)instance;
+ (void)setSharedOSDialogInstance:(NSObject<OSDialogPresenter> *_Nonnull)instance;
+ (NSObject<OSDialogPresenter> *_Nullable)sharedInstance;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,12 @@
#ifndef OneSignalClient_h
#define OneSignalClient_h

typedef void (^OSDataRequestSuccessBlock)(NSData *data);

typedef void (^OSMultipleCompletionBlock)(NSDictionary *responses);
typedef void (^OSMultipleFailureBlock)(NSDictionary<NSString *, NSError *> *errors);
typedef void (^OSMultipleSuccessBlock)(NSDictionary<NSString *, NSDictionary *> *results);

@interface OneSignalClient : NSObject
+ (OneSignalClient *)sharedClient;
@protocol IOneSignalClient <NSObject>
- (void)executeRequest:(OneSignalRequest *)request onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;
- (void)executeSynchronousRequest:(OneSignalRequest *)request onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;

// ie. for loading HTML or other non-JSON based requests
- (void)executeDataRequest:(OneSignalRequest *)request onSuccess:(OSDataRequestSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;

// Executes multiple OneSignalRequest's simultaneously, needs a unique identifier for each request
- (void)executeSimultaneousRequests:(NSDictionary<NSString *, OneSignalRequest *> *)requests withSuccess:(OSMultipleSuccessBlock)successBlock onFailure:(OSMultipleFailureBlock)failureBlock;

/*
TODO: We want to eventually migrate over to using this method for executing simultaneous requests:
This allows us to combine multiple async concurrent requests to return from a single callback with the proper formatted responses from each reuqest (successful or not, account for params returning from GETs).
A generalized format should be followed and we should make sure not to break form that as it could break peoples apps in the future if we add params and remove params from this callback.
Currently for the only implementation this is used for "setExternalUserId:withCOmpletion:" the format is as follows:
NSDictionary response = @{
(required) @"push" : {
@"success" : @(true) or @(false)
},
(optional) @"email" : {
@"success" : @(true) or @(false)
}
}
@end

Building off of this format now will require:
1. Including other attributes and whether they are required or not
ex. @"push" is always going to be within the callback resposne (required), meanwhile,
@"email" will not always exist in the callback resposne (optoinal)
2. Can't remove params that are required as an app may be expecting them and removing/modifying a key could break there app with an SDK upgrade
3. Add more requirements...
*/
- (void)executeSimultaneousRequests:(NSDictionary<NSString *, OneSignalRequest *> *)requests withCompletion:(OSMultipleCompletionBlock)completionBlock;
@interface OneSignalClient : NSObject <IOneSignalClient>
+ (OneSignalClient *)sharedClient;
@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// "*" in comment line ending comment means the string value has not been changed
// App

#define ONESIGNAL_VERSION @"050100"
#define ONESIGNAL_VERSION @"050103"

#define OSUD_APP_ID @"GT_APP_ID" // * OSUD_APP_ID
#define OSUD_REGISTERED_WITH_APPLE @"GT_REGISTERED_WITH_APPLE" // * OSUD_REGISTERED_WITH_APPLE
Expand Down Expand Up @@ -255,6 +255,9 @@ typedef enum {GET, POST, HEAD, PUT, DELETE, OPTIONS, CONNECT, TRACE, PATCH} HTTP

// Defines the maximum delay time for confirmed deliveries
#define MAX_CONF_DELIVERY_DELAY 25.0

// Flush interval for operation repo in milliseconds
#define POLL_INTERVAL_MS 5000
#else
// Test defines for API Client
#define REATTEMPT_DELAY 0.004
Expand All @@ -272,6 +275,9 @@ typedef enum {GET, POST, HEAD, PUT, DELETE, OPTIONS, CONNECT, TRACE, PATCH} HTTP
// We don't want to delay confirmed deliveries in unit tests
#define MAX_CONF_DELIVERY_DELAY 0

// Reduce flush interval for operation repo in tests
#define POLL_INTERVAL_MS 100

#endif

// A max timeout for a request, which might include multiple reattempts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@
#import <OneSignalCore/OneSignalWrapper.h>
#import <OneSignalCore/OSInAppMessages.h>
#import <OneSignalCore/OSLocation.h>

// TODO: Testing: Should this class be defined in this file?
@interface OneSignalCoreImpl : NSObject

+ (void)setSharedClient:(nonnull id<IOneSignalClient>)client;
+ (nonnull id<IOneSignalClient>)sharedClient;

@end
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dict>
<key>hash2</key>
<data>
TZyL4I0k2RDNt3IPxABcOPcjrjywMJ0x1SZXMXeiqxA=
Xi9ng0MWuNxky8LclThg6wlOCpltBy4ksR2hWWxT55Y=
</data>
</dict>
<key>Headers/OSInAppMessages.h</key>
Expand Down Expand Up @@ -134,14 +134,14 @@
<dict>
<key>hash2</key>
<data>
CSAZbyxJ1QBEtH5JYy/HwJiYsj+udPG1u4dhMFgkUtQ=
bZZ7bNHZy8Mym+UeVjwRL9HtlIxmmTNomVrGmmHcw2A=
</data>
</dict>
<key>Headers/OneSignalCommonDefines.h</key>
<dict>
<key>hash2</key>
<data>
jFVB6mq//2WLhfivs+XsCMKTED1ORLn5oxnpRIvdLbc=
Cq6IxW/DiUZubnyD/5/WSvbP+O5Y8RiYYaFm33SbGW0=
</data>
</dict>
<key>Headers/OneSignalConfigManager.h</key>
Expand All @@ -155,7 +155,7 @@
<dict>
<key>hash2</key>
<data>
CZNtCCWsZDtT4qPjBwdved+ePMTZHxOiPePJe2wbheY=
bNJqZIbqxv7lhnk5ArffKSp7Y82rYzXbvscXeyors2M=
</data>
</dict>
<key>Headers/OneSignalCoreHelper.h</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ typedef void (^OSDialogActionCompletion)(int tappedActionIndex);
@end

@interface OSDialogInstanceManager : NSObject
+ (void)setSharedInstance:(NSObject<OSDialogPresenter> *_Nonnull)instance;
+ (void)setSharedOSDialogInstance:(NSObject<OSDialogPresenter> *_Nonnull)instance;
+ (NSObject<OSDialogPresenter> *_Nullable)sharedInstance;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,12 @@
#ifndef OneSignalClient_h
#define OneSignalClient_h

typedef void (^OSDataRequestSuccessBlock)(NSData *data);

typedef void (^OSMultipleCompletionBlock)(NSDictionary *responses);
typedef void (^OSMultipleFailureBlock)(NSDictionary<NSString *, NSError *> *errors);
typedef void (^OSMultipleSuccessBlock)(NSDictionary<NSString *, NSDictionary *> *results);

@interface OneSignalClient : NSObject
+ (OneSignalClient *)sharedClient;
@protocol IOneSignalClient <NSObject>
- (void)executeRequest:(OneSignalRequest *)request onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;
- (void)executeSynchronousRequest:(OneSignalRequest *)request onSuccess:(OSResultSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;

// ie. for loading HTML or other non-JSON based requests
- (void)executeDataRequest:(OneSignalRequest *)request onSuccess:(OSDataRequestSuccessBlock)successBlock onFailure:(OSFailureBlock)failureBlock;

// Executes multiple OneSignalRequest's simultaneously, needs a unique identifier for each request
- (void)executeSimultaneousRequests:(NSDictionary<NSString *, OneSignalRequest *> *)requests withSuccess:(OSMultipleSuccessBlock)successBlock onFailure:(OSMultipleFailureBlock)failureBlock;

/*
TODO: We want to eventually migrate over to using this method for executing simultaneous requests:
This allows us to combine multiple async concurrent requests to return from a single callback with the proper formatted responses from each reuqest (successful or not, account for params returning from GETs).
A generalized format should be followed and we should make sure not to break form that as it could break peoples apps in the future if we add params and remove params from this callback.
Currently for the only implementation this is used for "setExternalUserId:withCOmpletion:" the format is as follows:
NSDictionary response = @{
(required) @"push" : {
@"success" : @(true) or @(false)
},
(optional) @"email" : {
@"success" : @(true) or @(false)
}
}
@end

Building off of this format now will require:
1. Including other attributes and whether they are required or not
ex. @"push" is always going to be within the callback resposne (required), meanwhile,
@"email" will not always exist in the callback resposne (optoinal)
2. Can't remove params that are required as an app may be expecting them and removing/modifying a key could break there app with an SDK upgrade
3. Add more requirements...
*/
- (void)executeSimultaneousRequests:(NSDictionary<NSString *, OneSignalRequest *> *)requests withCompletion:(OSMultipleCompletionBlock)completionBlock;
@interface OneSignalClient : NSObject <IOneSignalClient>
+ (OneSignalClient *)sharedClient;
@end

#endif
Loading

0 comments on commit bff21e5

Please sign in to comment.