-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Allow SNS Adapter to send to a topic #2444
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ node_modules | |
.vscode | ||
|
||
# Babel.js | ||
lib/ | ||
lib | ||
|
||
# cache folder | ||
.cache | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,9 @@ export class PushController extends AdaptableController { | |
let updateWhere = deepcopy(where); | ||
|
||
badgeUpdate = () => { | ||
if (updateWhere.arn){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the badge update skipped in that case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @flovilmart this could be improved in the future, and as fair as I know, when sending bulk PN via Topic with SNS, it is not possible to increment the badge, otherwise you need to go through all installations and Endpoints again, which can lead to high memory usage. We still able to send bulk PN and increment the badge if we want by passing the Installation Query |
||
return; | ||
} | ||
updateWhere.deviceType = 'ios'; | ||
// Build a real RestQuery so we can use it in RestWrite | ||
let restQuery = new RestQuery(config, master(config), '_Installation', updateWhere); | ||
|
@@ -88,6 +91,12 @@ export class PushController extends AdaptableController { | |
onPushStatusSaved(pushStatus.objectId); | ||
return badgeUpdate(); | ||
}).then(() => { | ||
if (this.adapter.snsConfig && where.arn){ | ||
body.data.badge = null // skip badge increment by bulk push send | ||
return { | ||
results : where | ||
} | ||
} | ||
return rest.find(config, auth, '_Installation', where); | ||
}).then((response) => { | ||
if (!response.results) { | ||
|
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.
Remove that change