Skip to content

[Bug]: OneSignal is undefined and ERROR TypeError: undefined is not a function (near '..._reactNativeOnesignal.default.init...') #1436

@adamchenwei

Description

@adamchenwei

What happened?

I followed all the steps to setup OneSignal React Native SDK according to https://documentation.onesignal.com/v7.0/docs/react-native-sdk-setup

But I can't get it running. when I load the app with the example code in the setup guide, I got this error

Screen Shot 2022-09-29 at 4 45 51 PM

Steps to reproduce?

1. follow https://documentation.onesignal.com/v7.0/docs/react-native-sdk-setup setup iOS & Android onesignal configs
2. start an app with ios emulator
3. observe error on ios emulator

node v 14.19.3
react-native-cli: 2.0.1
react-native: 0.68.2

What did you expect to happen?

no error

React Native OneSignal SDK version

4.4.1

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

ERROR  TypeError: undefined is not a function (near '..._reactNativeOnesignal.default.init...')

This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in rnPatientPortalUi(RootComponent)
 ERROR  TypeError: undefined is not a function (near '..._reactNativeOnesignal.default.init...')

This error is located at:
    in App
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in rnPatientPortalUi(RootComponent)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions