@dubsdotapp/expo 0.2.61 → 0.2.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app.plugin.js ADDED
@@ -0,0 +1,72 @@
1
+ const { withDangerousMod } = require('@expo/config-plugins');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ /**
6
+ * @dubsdotapp/expo Expo config plugin.
7
+ *
8
+ * Generates a google-services.json for the Dubs Firebase project using the
9
+ * app's own Android package name. This allows Firebase (and therefore FCM)
10
+ * to initialise automatically at runtime — no manual Firebase setup required.
11
+ *
12
+ * Usage in app.json:
13
+ * ["@dubsdotapp/expo"]
14
+ */
15
+ function withDubsNotifications(config) {
16
+ return withDangerousMod(config, [
17
+ 'android',
18
+ async (cfg) => {
19
+ const packageName = cfg.android?.package;
20
+ if (!packageName) {
21
+ throw new Error(
22
+ '@dubsdotapp/expo plugin: "android.package" must be set in app.json',
23
+ );
24
+ }
25
+
26
+ const googleServices = {
27
+ project_info: {
28
+ project_number: '161838368570',
29
+ project_id: 'dubs-a835d',
30
+ storage_bucket: 'dubs-a835d.firebasestorage.app',
31
+ },
32
+ client: [
33
+ {
34
+ client_info: {
35
+ mobilesdk_app_id: '1:161838368570:android:5d77e05a49f7efc64b7203',
36
+ android_client_info: {
37
+ package_name: packageName,
38
+ },
39
+ },
40
+ oauth_client: [],
41
+ api_key: [
42
+ {
43
+ current_key: 'AIzaSyCtJKF-o1cZ3Y89oM5FlXIGsjFchETzzkM',
44
+ },
45
+ ],
46
+ services: {
47
+ appinvite_service: {
48
+ other_platform_oauth_client: [],
49
+ },
50
+ },
51
+ },
52
+ ],
53
+ configuration_version: '1',
54
+ };
55
+
56
+ const projectRoot = cfg.modRequest.projectRoot;
57
+ const filePath = path.join(
58
+ projectRoot,
59
+ 'android',
60
+ 'app',
61
+ 'google-services.json',
62
+ );
63
+
64
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
65
+ fs.writeFileSync(filePath, JSON.stringify(googleServices, null, 2));
66
+
67
+ return cfg;
68
+ },
69
+ ]);
70
+ }
71
+
72
+ module.exports = withDubsNotifications;
package/dist/index.js CHANGED
@@ -95,6 +95,7 @@ if (typeof self === "undefined" && typeof globalThis !== "undefined") {
95
95
 
96
96
  // src/constants.ts
97
97
  var DEFAULT_BASE_URL = "https://dubs-server-prod-9c91d3f01199.herokuapp.com/api/developer/v1";
98
+ var DUBS_EXPO_PROJECT_ID = "aaca4fc9-64be-46b2-9be2-4175cb0f59a2";
98
99
  var DEFAULT_RPC_URL = "https://api.mainnet-beta.solana.com";
99
100
  var NETWORK_CONFIG = {
100
101
  "mainnet-beta": {
@@ -2430,7 +2431,9 @@ function usePushNotifications() {
2430
2431
  return false;
2431
2432
  }
2432
2433
  setHasPermission(true);
2433
- const tokenResult = await Notifications.getExpoPushTokenAsync();
2434
+ const tokenResult = await Notifications.getExpoPushTokenAsync({
2435
+ projectId: DUBS_EXPO_PROJECT_ID
2436
+ });
2434
2437
  const token = tokenResult.data;
2435
2438
  setExpoPushToken(token);
2436
2439
  await registerTokenWithServer(token);
@@ -2462,7 +2465,9 @@ function usePushNotifications() {
2462
2465
  if (!Notifications) return;
2463
2466
  const { status } = await Notifications.getPermissionsAsync();
2464
2467
  if (status !== "granted") return;
2465
- const tokenResult = await Notifications.getExpoPushTokenAsync();
2468
+ const tokenResult = await Notifications.getExpoPushTokenAsync({
2469
+ projectId: DUBS_EXPO_PROJECT_ID
2470
+ });
2466
2471
  const token = tokenResult.data;
2467
2472
  await registerTokenWithServer(token);
2468
2473
  setExpoPushToken(token);