Repository navigation
feat: Android SDK update for version 29.1.0-rc.3 - #139
Conversation
🔵 Tier A · Mergeable after minor fixes
Updates the Android SDK to 29.1.0-rc.3 and expands background push support with foreground-notification controls, permission helpers, refreshed authentication, revised scheduling, and bounded image decoding. Adds notification-tap APIs and an internal tap activity, forwards background connection lifecycle events, and automatically requests notification permission for background subscriptions. Latest changes: The newest commit bumps the version to rc.3, adds automatic notification-permission prompting, tracks background connection state when joining or leaving the host, and records notification taps after requesting the app launch.
Fix with agent prompt### Issue 1
library/src/main/java/io/appwrite/services/Push.kt:997-1000
**Coordinate automatic prompts with explicit permission requests**
`requestNotificationPermission()` never updates `asked`, so apps following the existing pattern of requesting permission and then subscribing immediately issue a second request while the first dialog is open; Android rejects overlapping requests and can deliver an empty permission result. If they subscribe after a denial instead, the SDK immediately prompts again—please share request state with the explicit helper.
### Issue 2
library/src/main/java/io/appwrite/services/Push.kt:555-559
**Make background connection deduplication atomic**
When joining a saved connection, `hostInBackground()` can call this on the caller thread while the MQTT connected listener calls it on its own thread. Both can read `backgroundOpen == false` before either writes it, firing `onOpen` twice despite the new deduplication; serialize the state transition and callback dispatch.
### Issue 3
CHANGELOG.md:5
**Describe the push behavior changes in the release notes**
This release changes SDK code substantially, including suppressing foreground notifications by default and adding `notifyInForeground` and background-permission APIs. Saying there are no SDK code changes hides a user-visible behavior change and the option consumers need to restore notifications.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 9
⏳ Still open from earlier reviews · 1
Reviewed the commits since |
|
|
||
| ## 29.1.0-rc.1 | ||
|
|
||
| * Updated: regenerated with sdk-generator 5.5.0; no SDK code changes |
There was a problem hiding this comment.
Describe the push behavior changes in the release notes
This release changes SDK code substantially, including suppressing foreground notifications by default and adding notifyInForeground and background-permission APIs. Saying there are no SDK code changes hides a user-visible behavior change and the option consumers need to restore notifications.
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 5
Comment:
**Describe the push behavior changes in the release notes**
This release changes SDK code substantially, including suppressing foreground notifications by default and adding `notifyInForeground` and background-permission APIs. Saying there are no SDK code changes hides a user-visible behavior change and the option consumers need to restore notifications.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · documentation · Reply if this doesn't apply.
| if (asked) { | ||
| return | ||
| } | ||
| asked = true |
There was a problem hiding this comment.
Coordinate automatic prompts with explicit permission requests
requestNotificationPermission() never updates asked, so apps following the existing pattern of requesting permission and then subscribing immediately issue a second request while the first dialog is open; Android rejects overlapping requests and can deliver an empty permission result. If they subscribe after a denial instead, the SDK immediately prompts again—please share request state with the explicit helper.
Prompt To Fix With AI
This is a comment left during a code review.
Path: library/src/main/java/io/appwrite/services/Push.kt
Line: 997-1000
Comment:
**Coordinate automatic prompts with explicit permission requests**
`requestNotificationPermission()` never updates `asked`, so apps following the existing pattern of requesting permission and then subscribing immediately issue a second request while the first dialog is open; Android rejects overlapping requests and can deliver an empty permission result. If they subscribe after a denial instead, the SDK immediately prompts again—please share request state with the explicit helper.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · bug · Reply if this doesn't apply.
| private fun backgroundConnection(open: Boolean) { | ||
| if (backgroundOpen == open) { | ||
| return | ||
| } | ||
| backgroundOpen = open |
There was a problem hiding this comment.
Make background connection deduplication atomic
When joining a saved connection, hostInBackground() can call this on the caller thread while the MQTT connected listener calls it on its own thread. Both can read backgroundOpen == false before either writes it, firing onOpen twice despite the new deduplication; serialize the state transition and callback dispatch.
Prompt To Fix With AI
This is a comment left during a code review.
Path: library/src/main/java/io/appwrite/services/Push.kt
Line: 555-559
Comment:
**Make background connection deduplication atomic**
When joining a saved connection, `hostInBackground()` can call this on the caller thread while the MQTT connected listener calls it on its own thread. Both can read `backgroundOpen == false` before either writes it, firing `onOpen` twice despite the new deduplication; serialize the state transition and callback dispatch.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · concurrency · Reply if this doesn't apply.
This PR contains updates to the Android SDK for version 29.1.0-rc.3.
What's Changed
POST_NOTIFICATIONS(Android 13+) from the visible activityonOpen/onClosecallbacks fire correctly when joining or leaving the background hostRegenerated with sdk-generator 5.5.2.