Open macMikey opened 2 years ago
thank. I will look at it
For 1. and 2. I have merged a PullRequest #5 (where you can see the change) I will update 19R4 too (EDIT: 21e12fa77a06206ef0fbba611713a28e7faae443 )
For 3. because I could not see clearly what it is proposed, you could PullRequest just by editing on github https://github.com/4d-go-mobile/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/buildNotification.4dm#L105 to propose new code (event if it not compile or not indented)
For 4. Yes now we could do pull request on Main branch (maybe beta branch too later, like 19R4, I will talk about that because now I must do manually code reporting)
The following code will not set the badge of a mobile app:
Discussion:
Inside of project method buildNotification on line 51, the value type of badge is evaluated:
Even the literal 1 evaluates to Is real in this code. I tried a variety of workarounds to resolve this issue, including
but none of the things I have tried have worked.
Workaround:
The code does allow the developer to manually build a push notification using the userInfo object, however it cannot be used to supplement the other settings (like title and body, as it will overwrite other properties, so you cannot, for example use
because even though $notification.aps.title is initially set, using userInfo.aps will cause the code to wipe the other properties of aps instead of appending the aps.badge property. However, you can build the entire aps object using this technique:
Suggestions for resolving this issue:
In the buildNotification project method:
$key
and inserts$1.userInfo[$key]
but does not wipe any existing property or object. This would make the code more future-proof since Apple is likely to modify the APNS Dictionary and Alert keys in the future.