about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.easignore102
-rw-r--r--src/lib/notifications/notifications.ts9
2 files changed, 108 insertions, 3 deletions
diff --git a/.easignore b/.easignore
new file mode 100644
index 000000000..cdf1b7abf
--- /dev/null
+++ b/.easignore
@@ -0,0 +1,102 @@
+# OSX
+#
+.DS_Store
+
+# Xcode
+#
+build/
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata
+*.xccheckout
+*.moved-aside
+DerivedData
+*.hmap
+*.ipa
+*.xcuserstate
+
+# Android/IntelliJ
+#
+build/
+.idea
+.gradle
+local.properties
+*.iml
+*.hprof
+
+# node.js
+#
+node_modules/
+npm-debug.log
+yarn-error.log
+
+# BUCK
+buck-out/
+\.buckd/
+*.keystore
+!debug.keystore
+
+# fastlane
+#
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# screenshots whenever they are needed.
+# For more information about the recommended setup visit:
+# https://docs.fastlane.tools/best-practices/source-control/
+
+*/fastlane/report.xml
+*/fastlane/Preview.html
+*/fastlane/screenshots
+
+# Bundle artifact
+*.jsbundle
+
+# Ruby / CocoaPods
+/ios/Pods/
+/vendor/bundle/
+
+# Testing
+coverage/
+junit.xml
+artifacts
+
+# Web bundle outputs
+/dist/
+
+# Expo
+.expo/
+dist/
+*.jks
+*.p8
+*.p12
+*.key
+*.mobileprovision
+*.orig.*
+web-build/
+
+# Temporary files created by Metro to check the health of the file watcher
+.metro-health-check*
+
+# VSCode
+.vscode
+
+# gitignore and github actions
+!.gitignore
+!.github
+
+
+# Android & iOS folders
+android/
+ios/
+
+# environment variables
+.env
+.env.*
+
+# Firebase (Android) Google services
+# INCLUDED: google-services.json
\ No newline at end of file
diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts
index b517b40bf..2a9ed8706 100644
--- a/src/lib/notifications/notifications.ts
+++ b/src/lib/notifications/notifications.ts
@@ -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',