OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.56k stars 369 forks source link

One signal not returning ID on iOS #1049

Closed mohamed-ahmed closed 3 years ago

mohamed-ahmed commented 3 years ago

Description: One signal not returning ID on iOS

(your description here)

Environment

MacOS react-native-onesignal@3.9.1 Installed using iOS instructions here https://documentation.onesignal.com/docs/react-native-sdk-setup Xcode version 12.0

Steps to Reproduce Issue:

  1. Install the OneSignal SDK in your project
  2. Run on simulator or device
  3. Device asks for notifiation permission

Anything else:

Screenshot of xcode set up image

Podfile

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'

platform :ios, '10.0'

target 'ReactNativeStarter' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])

  target 'ReactNativeStarterTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!
  # post_install do |installer|
  #   flipper_post_install(installer)
  # end
end

target 'ReactNativeStarter-tvOS' do
  # Pods for ReactNativeStarter-tvOS

  target 'ReactNativeStarter-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignal', '>= 2.9.3', '< 3.0'
end

package.json

{
  "name": "react-native-starter",
  "version": "2.1.0",
  "private": false,
  "scripts": {
    "start": "react-native start",
    "test": "jest --runInBand",
    "test:update": "jest -u",
    "test:coverage": "jest --coverage",
    "run:ios": "react-native run-ios",
    "run:android": "react-native run-android",
    "lint": "./node_modules/eslint/bin/eslint.js src",
    "lint:fix": "./node_modules/eslint/bin/eslint.js src --fix",
    "flow": "./node_modules/flow-bin/cli.js",
    "e2e:build": "detox build --configuration ios.sim.debug",
    "e2e:test": "detox test --configuration ios.sim.debug"
  },
  "dependencies": {
    "@react-native-community/blur": "3.6.0",
    "@react-native-community/datetimepicker": "^3.0.2",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.9",
    "@react-native-community/netinfo": "5.9.7",
    "@react-native-community/picker": "^1.8.0",
    "@react-navigation/bottom-tabs": "^5.2.6",
    "@react-navigation/drawer": "^5.4.1",
    "@react-navigation/native": "^5.1.5",
    "@react-navigation/stack": "^5.2.10",
    "axios": "^0.19.2",
    "crypto-js": "3.1.9-1",
    "geolib": "^3.3.1",
    "global": "^4.4.0",
    "i18n-js": "^3.2.1",
    "jetifier": "^1.6.5",
    "lodash": "^4.17.13",
    "moment": "^2.24.0",
    "react": "16.13.1",
    "react-native": "0.63.2",
    "react-native-calendars": "1.265.0",
    "react-native-device-info": "^5.6.1",
    "react-native-geocoding": "^0.4.0",
    "react-native-gesture-handler": "^1.5.0",
    "react-native-gifted-chat": "^0.11.3",
    "react-native-google-places-autocomplete": "^1.7.1",
    "react-native-lightbox": "^0.8.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^1.3.1",
    "react-native-modal": "^9.0.0",
    "react-native-modal-datetime-picker": "^6.0.0",
    "react-native-modal-dropdown": "0.6.2",
    "react-native-onesignal": "^3.9.1",
    "react-native-paper": "^3.1.1",
    "react-native-reanimated": "^1.8.0",
    "react-native-safe-area-context": "^0.7.3",
    "react-native-screens": "^2.5.0",
    "react-native-ui-lib": "5.14.0",
    "react-native-vector-icons": "^7.0.0",
    "react-redux": "^6.0.1",
    "recompose": "^0.30.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-persist": "^5.10.0",
    "redux-promise": "^0.6.0",
    "redux-thunk": "^2.3.0",
    "victory-native": "^31.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.5.0",
    "@babel/preset-flow": "^7.0.0",
    "@babel/runtime": "^7.5.0",
    "@react-native-community/eslint-config": "^0.0.3",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^24.1.0",
    "danger": "^7.0.2",
    "enzyme": "^3.7.0",
    "enzyme-adapter-react-16": "^1.7.0",
    "eslint": "^5.9.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-prettier": "^3.6.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.2",
    "eslint-plugin-react": "^7.11.1",
    "flow-bin": "^0.105.0",
    "jest": "^24.1.0",
    "jest-chance": "^0.1.8",
    "jsdom": "13.0.0",
    "jsdom-global": "3.0.2",
    "metro-react-native-babel-preset": "^0.51.1",
    "plop": "^2.2.0",
    "prettier": "^1.16.1",
    "react-addons-test-utils": "^15.6.2",
    "react-dom": "^16.6.3",
    "react-test-renderer": "16.8.1",
    "sinon": "^7.1.1"
  },
  "jest": {
    "preset": "react-native",
    "globalSetup": "jest-chance",
    "testEnvironment": "node",
    "transform": {
      "^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
    },
    "collectCoverage": true,
    "collectCoverageFrom": [
      "src/**/*.{js,jsx}",
      "!**/node_modules/**",
      "!android/**",
      "!ios/**",
      "!assets/**"
    ],
    "coverageDirectory": "jest_coverage",
    "setupFiles": [
      "./jest-setup.js"
    ],
    "testPathIgnorePatterns": [
      "/node_modules/",
      "/e2e/"
    ]
  },
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  },
  "detox": {
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/ReactNativeStarter.app",
        "build": "xcodebuild -UseModernBuildSystem=NO -project ios/ReactNativeStarter.xcodeproj -scheme ReactNativeStarter -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
        "type": "ios.simulator",
        "name": "iPhone XS"
      },
      "ios.sim.release": {
        "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/ReactNativeStarter.app",
        "build": "xcodebuild -UseModernBuildSystem=NO -project ios/ReactNativeStarter.xcodeproj -scheme ReactNativeStarter -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
        "type": "ios.simulator",
        "name": "iPhone 7"
      }
    },
    "test-runner": "jest"
  }
}

In app.js image

onIds event in question which is not fired

rgomezp commented 3 years ago

Howdy, Please include a logcat with setLogLevel set to VERBOSE. Thank you

https://documentation.onesignal.com/docs/sdk-reference#setloglevel-method https://documentation.onesignal.com/docs/troubleshooting-ios#troubleshooting-steps

rgomezp commented 3 years ago

Closing due to no response.