Commit 90c491a
committed
Implement cross-platform push completion handling for background tasks (opt-in).
Added Display.notifyPushCompletion() to manually signal the completion of a background push task.
This mechanism is OPT-IN via the `delayPushCompletion` (or `android.delayPushCompletion`/`ios.delayPushCompletion`) build hint.
If the hint is present and true:
- Android: Acquires a `PARTIAL_WAKE_LOCK` upon receiving a push, preventing the device from sleeping until `notifyPushCompletion()` is called (or timeout).
- iOS: Ensures the `remote-notification` background mode is enabled and delays firing the system completion handler until `notifyPushCompletion()` is called.
If the hint is NOT present (default behavior):
- Android: No wake lock is acquired.
- iOS: The completion handler is fired immediately after the push callback.
Updated `IOSImplementation`, `AndroidImplementation`, `PushNotificationService`, `AndroidGradleBuilder`, and `IPhoneBuilder`.1 parent 79a6d12 commit 90c491a
File tree
3 files changed
+12
-4
lines changed- Ports/Android/src/com/codename1/impl/android
- maven/codenameone-maven-plugin/src/main/java/com/codename1/builders
3 files changed
+12
-4
lines changedLines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
119 | | - | |
| 122 | + | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1166 | 1170 | | |
1167 | 1171 | | |
1168 | 1172 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2380 | 2380 | | |
2381 | 2381 | | |
2382 | 2382 | | |
2383 | | - | |
| 2383 | + | |
| 2384 | + | |
2384 | 2385 | | |
2385 | 2386 | | |
2386 | 2387 | | |
| |||
0 commit comments