Put app view DIDs in constants
This commit is contained in:
@@ -201,3 +201,6 @@ export const urls = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const PUBLIC_APPVIEW_DID = 'did:web:api.bsky.app'
|
||||||
|
export const PUBLIC_STAGING_APPVIEW_DID = 'did:web:api.staging.bsky.dev'
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {getBadgeCountAsync, setBadgeCountAsync} from 'expo-notifications'
|
|||||||
import {type AtpAgent} from '@atproto/api'
|
import {type AtpAgent} from '@atproto/api'
|
||||||
import debounce from 'lodash.debounce'
|
import debounce from 'lodash.debounce'
|
||||||
|
|
||||||
|
import {PUBLIC_APPVIEW_DID, PUBLIC_STAGING_APPVIEW_DID} from '#/lib/constants'
|
||||||
import {Logger} from '#/logger'
|
import {Logger} from '#/logger'
|
||||||
import {isNative} from '#/platform/detection'
|
import {isNative} from '#/platform/detection'
|
||||||
import {type SessionAccount, useAgent, useSession} from '#/state/session'
|
import {type SessionAccount, useAgent, useSession} from '#/state/session'
|
||||||
@@ -28,13 +29,9 @@ async function _registerPushToken({
|
|||||||
try {
|
try {
|
||||||
await agent.app.bsky.notification.registerPush({
|
await agent.app.bsky.notification.registerPush({
|
||||||
serviceDid: currentAccount.service?.includes('staging')
|
serviceDid: currentAccount.service?.includes('staging')
|
||||||
? 'did:web:api.staging.bsky.dev'
|
? PUBLIC_STAGING_APPVIEW_DID
|
||||||
: 'did:web:api.bsky.app',
|
: PUBLIC_APPVIEW_DID,
|
||||||
platform: Platform.select({
|
platform: Platform.OS,
|
||||||
ios: 'ios',
|
|
||||||
android: 'android',
|
|
||||||
default: 'web',
|
|
||||||
}),
|
|
||||||
token: token.data,
|
token: token.data,
|
||||||
appId: 'xyz.blueskyweb.app',
|
appId: 'xyz.blueskyweb.app',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user