Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Significant Drop in Confirmed Deliveries After Migration to v5 + Expo #1760

Open
2 of 3 tasks
pilotpirxie opened this issue Nov 13, 2024 · 5 comments
Open
2 of 3 tasks

Comments

@pilotpirxie
Copy link

pilotpirxie commented Nov 13, 2024

What happened?

Hi, after upgrading from OneSignal v4 to v5 and switching to Expo, we've observed a significant decrease in confirmed notification deliveries in the OneSignal dashboard, dropping from ~600k to ~400k per day. This occurred without any noticeable change in user base or uninstall rates.

On November 7 I rolled out 50% deployment of the new expo version with v5 to Google Play. Yesterday, November 12 I rolled out 100%. As you can see on the chart since releasing a version with v5 there is a decreasing trend of confirmed delivery.

Screenshot 2024-11-13 at 12 15 38 Screenshot 2024-11-13 at 11 39 23

Before (Working Better)

  • OneSignal SDK: v4
  • React Native: Bare workflow
  • Notifications confirmed: ~600k per day

After (Current Issue)

  • OneSignal SDK: v5.2.5
  • React Native: Expo managed workflow
  • onesignal-expo-plugin
  • Notifications confirmed: ~400k per day

Users are still receiving notifications, only the confirmation rate has dropped.
No changes were made to the Firebase configuration.

Are there known differences in how v4 and v5 handle delivery confirmations?

Does the Expo plugin handle permissions or background processes differently than the bare workflow?

Is this a known issue with the migration from bare to Expo workflow?

Steps to reproduce?

Initialization Code

// App.tsx
useEffect(() => {
  OneSignal.Debug.setLogLevel(LogLevel.Verbose);
  OneSignal.initialize('my-app-id');

  const av = new Animated.Value(0);
  av.addListener(() => {
    return;
  });
}, []);

Permission Request (during onboarding)

export const askForNotificationPermission = async ({
  dispatch,
  userNotificationTags,
}: {
  dispatch: RootDispatch;
  userNotificationTags: UserNotificationTag[];
}): Promise<void> => {
  try {
    const canAsk = await OneSignal.Notifications.canRequestPermission();
    if (!canAsk) {
      saveNotificationState(dispatch, false);
      return;
    }

    const isPermissionGranted = await OneSignal.Notifications.requestPermission(false);
    saveNotificationState(dispatch, isPermissionGranted);

    if (!isPermissionGranted) return;

    sendNotificationTags({ userNotificationTags });
    saveNotificationTimestamp(dispatch);

  } catch (error) {
    console.error('Error asking for notification permission:', error);
  }
};

app.json

{
  "plugins": [
    [
      "onesignal-expo-plugin",
      {
        "mode": "production",
        "devTeam": "my-dev-team-id",
        "iPhoneDeploymentTarget": "14.7"
      }
    ]
  ],
  "extra": {
    "oneSignalAppId": "my-app-id"
  }
}

package.json

{
  "name": "my-app-name",
  "version": "1.0.0",
  "main": "expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "yarn prebuild && expo run:android",
    "ios": "yarn prebuild && expo run:ios",
    "ios:device": "expo run:ios --device",
    "web": "expo start --web",
    "prebuild": "expo prebuild && node ./prebuild-fixes.js",
    "prebuild:clean": "expo prebuild --clean && node ./prebuild-fixes.js",
    "build:ios": "expo run:ios --configuration Release",
    "check-compatibility": "npx expo install --check",
    "lint": "eslint ./src/",
    "fix": "eslint --fix --ext .js,.jsx,.ts,.tsx ./src/",
    "build:android": "cd android && ./gradlew clean && ./gradlew bundleRelease && cd .. && open ./android/app/build/outputs/bundle/release",
    "build:android:apk": "cd android && ./gradlew assembleRelease && cd .. && open ./android/app/build/outputs/apk/release"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-community/netinfo": "11.3.1",
    "@react-native-firebase/analytics": "^21.2.0",
    "@react-native-firebase/app": "^21.2.0",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/stack": "^6.4.1",
    "@reduxjs/toolkit": "^2.2.7",
    "@sentry/react-native": "^6.1.0",
    "axios": "^1.7.7",
    "dayjs": "^1.11.11",
    "expo": "~51.0.28",
    "expo-apple-authentication": "~6.4.2",
    "expo-application": "~5.9.1",
    "expo-build-properties": "~0.12.5",
    "expo-clipboard": "~6.0.3",
    "expo-constants": "~16.0.2",
    "expo-crypto": "~13.0.2",
    "expo-status-bar": "~1.12.1",
    "expo-tracking-transparency": "~4.0.2",
    "immer": "^10.1.1",
    "onesignal-expo-plugin": "^2.0.3",
    "react": "18.2.0",
    "react-native": "0.74.5",
    "react-native-date-picker": "^5.0.7",
    "react-native-fbsdk-next": "^13.1.3",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-kochava-tracker": "^2.8.2",
    "react-native-onesignal": "^5.2.5",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "4.10.5",
    "react-native-screens": "3.31.1",
    "react-redux": "^9.1.2",
    "redux": "^4.2.1",
    "redux-saga": "^1.3.0",
    "symbol-observable": "^4.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.2.45",
    "@typescript-eslint/eslint-plugin": "^8.11.0",
    "@typescript-eslint/parser": "^8.11.0",
    "eslint": "^8.57.0",
    "eslint-config-expo": "~7.1.2",
    "eslint-plugin-react": "^7.37.2",
    "eslint-plugin-react-native": "^4.1.0",
    "eslint-plugin-simple-import-sort": "^12.1.1",
    "typescript": "^5.1.3"
  },
  "private": true
}

What did you expect to happen?

This issue affects our ability to track notification delivery rates accurately and impacts our analytics reliability. While notifications are still being delivered, we see a ~33% drop in confirmed deliveries and going down further.

React Native OneSignal SDK version

5.2.5

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pilotpirxie
Copy link
Author

What's interesting is that we found the number of clicks in our partners remained at the same level during that time. So OneSignal is wrong about calculating deliveries and clicks while notifications are delivered successfully. We are still investigating the problem but your support is tough to work with even with "Priority support" included in our Professional plan.

@chriszs
Copy link

chriszs commented Dec 6, 2024

Seeing this also. Also very puzzled by it.

@chriszs
Copy link

chriszs commented Dec 6, 2024

In my case, it was just an upgrade from v4 to v5. Already using Expo, the config plugin.

@pilotpirxie
Copy link
Author

pilotpirxie commented Dec 6, 2024

It's good to know we are not alone. It's a shame we pay about $1k per month and the official SDK is so poorly supported.

@pilotpirxie
Copy link
Author

pilotpirxie commented Dec 18, 2024

Update to the case. Also in Firebase, we see a significant drop in os_notification_received and other onesignal related Firebase events.

Screenshot 2024-12-18 at 14 46 49

The day we released:

Screenshot 2024-12-18 at 14 48 31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants