-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live Activity Support #1152
Live Activity Support #1152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 6 files reviewed, 5 unresolved discussions (waiting on @fhboswell, @jennantilla, @jkasten2, and @nan-li)
iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OSRequests.m
line 500 at r1 (raw file):
appId:(NSString * _Nonnull)appId activityId:(NSString * _Nonnull)activityId token:(NSString * _Nullable)token {
Design question - Are we sure the token should be nullable? Is this so that folks can track a live activity with OneSignal even if they aren't updating it via push?
iOS_SDK/OneSignalSDK/Source/OneSignal.h
line 298 at r1 (raw file):
#pragma mark Live Activity typedef void (^OSLiveActivitySuccessBlock)();
Design question - Is there any server response info we want to pass as a parameter to this? My gut reaction is that there isn't, but thought I would ask.
iOS_SDK/OneSignalSDK/Source/OneSignal.m
line 671 at r1 (raw file):
} + (void)enterLiveActivity:(NSString * _Nonnull)activityId withToken:(NSString * _Nullable)token withSuccess:(OSLiveActivitySuccessBlock _Nullable)successBlock withFailure:(OSLiveActivityFailureBlock _Nullable)failureBlock{
We probably want to check privacy consent here (see sendTags for an example)
iOS_SDK/OneSignalSDK/Source/OneSignal.m
line 672 at r1 (raw file):
+ (void)enterLiveActivity:(NSString * _Nonnull)activityId withToken:(NSString * _Nullable)token withSuccess:(OSLiveActivitySuccessBlock _Nullable)successBlock withFailure:(OSLiveActivityFailureBlock _Nullable)failureBlock{ [OneSignalClient.sharedClient executeRequest:[OSRequestLiveActivityEnter withUserId:self.currentSubscriptionState.userId appId:appId activityId:activityId token:token]
What happens if we don't have the userId yet? We should probably queue it up as a pending call to make once register user has finished successfully. See tags as an example.
iOS_SDK/OneSignalSDK/Source/OneSignal.m
line 685 at r1 (raw file):
+ (void)exitLiveActivity:(NSString * _Nonnull)activityId withSuccess:(OSLiveActivitySuccessBlock _Nullable)successBlock withFailure:(OSLiveActivityFailureBlock _Nullable)failureBlock{
same comments for Exit as in Enter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 6 files reviewed, 7 unresolved discussions (waiting on @emawby, @fhboswell, @jennantilla, @jkasten2, and @nan-li)
iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OSRequests.m
line 500 at r1 (raw file):
Previously, emawby (Elliot Mawby) wrote…
Design question - Are we sure the token should be nullable? Is this so that folks can track a live activity with OneSignal even if they aren't updating it via push?
It should not be nullable
iOS_SDK/OneSignalSDK/Source/OneSignal.h
line 298 at r1 (raw file):
Previously, emawby (Elliot Mawby) wrote…
Design question - Is there any server response info we want to pass as a parameter to this? My gut reaction is that there isn't, but thought I would ask.
Neither API endpoint has anything data in the response, see tech spec.
iOS_SDK/OneSignalSDK/Source/OneSignal.h
line 301 at r1 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
token
should be_Nonnull
, as it is required.
Done.
iOS_SDK/OneSignalSDK/Source/OneSignal.h
line 302 at r1 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
same
_Nonnull
as noted above.
Done.
iOS_SDK/OneSignalSDK/Source/OneSignal.m
line 671 at r1 (raw file):
Previously, emawby (Elliot Mawby) wrote…
We probably want to check privacy consent here (see sendTags for an example)
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 6 files reviewed, 7 unresolved discussions (waiting on @emawby, @jennantilla, @jkasten2, and @nan-li)
iOS_SDK/OneSignalSDK/Source/OneSignal.m
line 685 at r1 (raw file):
Previously, emawby (Elliot Mawby) wrote…
same comments for Exit as in Enter
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 6 files reviewed, 2 unresolved discussions (waiting on @jennantilla, @jkasten2, and @nan-li)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 6 files at r1, 2 of 4 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @fhboswell, @jennantilla, and @nan-li)
iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OSRequests.m
line 500 at r3 (raw file):
appId:(NSString * _Nonnull)appId activityId:(NSString * _Nonnull)activityId token:(NSString * _Nullable)token {
token here should be _Nonnull
.
iOS_SDK/OneSignalSDK/Source/OneSignal.m
line 722 at r3 (raw file):
+ (void)executePendingLiveActivityUpdates{ if(pendingLiveActivityUpdates.count <= 0){
nit, missing spaces which doesn't match the rest of the formatting. Here as well as a few other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 6 files reviewed, 1 unresolved discussion (waiting on @jennantilla, @jkasten2, and @nan-li)
iOS_SDK/OneSignalSDK/OneSignalCore/Source/API/OSRequests.m
line 500 at r3 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
token here should be
_Nonnull
.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissed @jkasten2 from a discussion.
Reviewable status: 3 of 6 files reviewed, all discussions resolved (waiting on @jennantilla, @jkasten2, and @nan-li)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @jennantilla and @nan-li)
Description
One Line Summary
Adds Live Activity support for the SDK
Details
Motivation
Adding 2 sdk methods that allow a customer to register their temporary live activity token with an activity ID on OneSignal's backend
Scope
Adding two SDK public methods and two corresponding requests
Testing
Unit testing
Added several tests to test the requests and the public SDK method
Manual testing
The backend piece is not available yet so only testing with mock data.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)