title: integrating OneSignal into Ionic 3 causes problem on iOS device
body: <p>I have an ionic application which works fine both on android and iOS, in simulator and in real devices.
  I have integrated the OneSignal API to add notifications to my application.
  On android everything works fine, but the problem shows up when running on an iOS device.</p>
  
  <p>These are the steps I use to run the project on iOS:
  - Add the iOS platform with the command <code>ionic cordova platform add ios</code>
  - Build the ionic app source to generate the Xcode project with the command <code>ionic cordova build ios --prod</code> or <code>ionic cordova build ios</code>
  - Open generated project in Xcode
  - Assign the team to the project
  - Add push notification to project from the tab 'capabilities'
  - Add remote notification to background mode
  - Generate the .cer and .p12 certifications
  - Add them to The OneSignal project on the OneSignal dashboard
  - Run the project</p>
  
  <p>After that when I build the app from Xcode to the iOS device (connected to my mac via a cable), the notification permission popup appears, I accept it and the notifications comes when I send them from the OneSignal dashboard.
  But when I try running the app again (with the iOS device not connected to the mac) it does not work, the splash screen keeps loading infinitely.</p>
  
  <p>I noticed another thing that when building with <code>--prod</code> flag the app does not work neither when connected to the mac or not. But without that flag, it works only when running it from Xcode as I said before.</p>
  
  <p>I am almost certain that's due to the OneSignal API since without it, everything works fine when connected to the mac or not.</p>
  
  <p>OneSignal version: ^2.4.2 </p>
  
  <p>iOS version: 10.3.3</p>
  
  <p>Ionic info:</p>
  
  <pre>Ionic:
  
     ionic (Ionic CLI)  : 4.0.6 (/usr/local/lib/node_modules/ionic)
     Ionic Framework    : ionic-angular 3.9.2
     @ionic/app-scripts : 3.1.9
  
  Cordova:
  
     cordova (Cordova CLI) : 8.0.0
     Cordova Platforms     : ios 4.5.5
  
  System:
  
     ios-deploy : 2.0.0
     NodeJS     : v8.10.0 (/usr/local/bin/node)
     npm        : 5.6.0
     OS         : macOS High Sierra
     Xcode      : Xcode 9.3 Build version 9E145
  
  Environment:
  
     ANDROID_HOME : not set</pre>