A couple quick notifications fixes (#1262)
* Create separate .easignore to ensure google-services.json goes to eas * Set the notifications serviceDid according to the session host * Fix types
This commit is contained in:
parent
93d5ba1820
commit
c1c02f480b
2 changed files with 108 additions and 3 deletions
|
@ -3,7 +3,10 @@ import {RootStoreModel} from '../../state'
|
|||
import {resetToTab} from '../../Navigation'
|
||||
import {devicePlatform, isIOS} from 'platform/detection'
|
||||
|
||||
// TODO prod did = did:web:api.bsky.app
|
||||
const SERVICE_DID = (serviceUrl?: string) =>
|
||||
serviceUrl?.includes('staging')
|
||||
? 'did:web:api.staging.bsky.dev'
|
||||
: 'did:web:api.bsky.app'
|
||||
|
||||
export function init(store: RootStoreModel) {
|
||||
store.onUnreadNotifications(count => Notifications.setBadgeCountAsync(count))
|
||||
|
@ -20,7 +23,7 @@ export function init(store: RootStoreModel) {
|
|||
if (token) {
|
||||
try {
|
||||
await store.agent.api.app.bsky.notification.registerPush({
|
||||
serviceDid: 'did:web:api.staging.bsky.dev',
|
||||
serviceDid: SERVICE_DID(store.session.data?.service),
|
||||
platform: devicePlatform,
|
||||
token: token.data,
|
||||
appId: 'xyz.blueskyweb.app',
|
||||
|
@ -41,7 +44,7 @@ export function init(store: RootStoreModel) {
|
|||
if (t) {
|
||||
try {
|
||||
await store.agent.api.app.bsky.notification.registerPush({
|
||||
serviceDid: 'did:web:api.staging.bsky.dev',
|
||||
serviceDid: SERVICE_DID(store.session.data?.service),
|
||||
platform: devicePlatform,
|
||||
token: t,
|
||||
appId: 'xyz.blueskyweb.app',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue