Fail to use Auth Services


#1

Hi there, good day to all.
Im a newbie to Ionic2. I came across with some problems when implementing the Auth Cloud Service in my Ionic 2 project.
I have followed the documentation from https://docs.ionic.io/setup.html
but i failed at the Configuration step, when i pass the cloud setting to @NgModule, i came up with the error as follow:

But before that my apps was runnning ok.
does any faced this error before or anyone can help please???:sweat:


#2

Hi, @laimc

Could you add

import { CloudSettings, CloudModule } from '@ionic/cloud-angular';

const cloudSettings: CloudSettings = {
  'core': {
    'app_id': 'here is your app id'
  },
  'push': {
    'sender_id': 'here is your sender id',
    'pluginConfig': {
      'ios': {
        'badge': true,
        'sound': true
      },
      'android': {
        'iconColor': '#343434'
      }
    }
  }
};
@NgModule({
  declarations: [
    MyApp,
    Page1,
    Page2,
    Notify
  ],
  imports: [IonicModule.forRoot(MyApp),
  CloudModule.forRoot(cloudSettings)
  ],

Hope this will solve your issue.

Feel free to mark it as a solution and you can always like the answer by clicking heart icon.


#3

hi there,may i know where can i get the sender id?


#4

Hi @laimc

Yes you can get the Sender ID form the FCM (Firebase Cloud Messaging) Link given below:

https://console.firebase.google.com

Hope this will solve your issue.

Feel free to mark it as a solution and you can always like the answer by clicking heart icon.


#5

hi there, i have tried your solution. however, the same error keep coming back.:sweat:


#6

Hi @laimc

Check the Below link,Install all module and integration configure.


#7

Post your package.json and output of ionic info please. I think the Ionic Services docs make some assumptions about libraries being there that aren’t true any more with the default upgrade to Ionic Native v3,


#8

hi there, heres my package.json

{
  "name": "ionic-hello-world",
  "version": "0.0.0",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.0.2",
    "@angular/compiler": "4.0.2",
    "@angular/compiler-cli": "4.0.2",
    "@angular/core": "4.0.2",
    "@angular/forms": "4.0.2",
    "@angular/http": "4.0.2",
    "@angular/platform-browser": "4.0.2",
    "@angular/platform-browser-dynamic": "4.0.2",
    "@ionic-native/core": "3.4.2",
    "@ionic-native/splash-screen": "3.4.2",
    "@ionic-native/status-bar": "3.4.2",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.1.1",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.5"
	
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.6",
    "typescript": "~2.2.1"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [],
  "description": "tryagain: An Ionic project"
}

and my ionic info


#9

hi there, i have followed the instruction given…still i got the error


#10

You are missing the import of @ionic/cloud-angular.

Did you really follow the v2 documentation? I unfortunately can’t link directly to it, you have to select “v2” on the top left. Then in https://docs.ionic.io/setup.html#installation it says to npm install @ionic/cloud-angular --save.


#11

hi there…i have followed the instruction as i mentioned before and i tried it again and again…
however, the error keeps coming back…

the error appear when i pass cloud settings into CloudModule.forRoot()
i have check my node_modules and found both the ionic-native and the @ionic/cloud-angular are there