From 261d227ad9929a973ba9c7b360cd7b0c45599a62 Mon Sep 17 00:00:00 2001 From: job Date: Mon, 13 Jun 2016 09:57:50 +0200 Subject: [PATCH] Ionic Cloud --- app/main.ts | 15 +++++++-------- app/services/auth.ts | 2 +- package.json | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/main.ts b/app/main.ts index 09e061f..0681005 100644 --- a/app/main.ts +++ b/app/main.ts @@ -2,7 +2,7 @@ import { provide } from '@angular/core'; import { Http } from '@angular/http'; import { ionicBootstrap } from 'ionic-angular'; import { AuthConfig, AuthHttp } from 'angular2-jwt'; -import { providers as ionicPlatformProviders } from '@ionic/platform-client-angular'; +import { CloudSettings, provideCloud } from '@ionic/cloud-angular'; import { LustrumApp } from './app'; import { ApiData } from './services/api-data'; @@ -10,7 +10,7 @@ import { AuthService } from './services/auth'; import { NotificationService } from './services/notification'; -let ionicPlatformConfig = { +const cloudSettings: CloudSettings = { core: { app_id: 'b4141034', gcm_key: '335763697269', @@ -34,7 +34,7 @@ let ionicPlatformConfig = { } }; -let ionicConfig = { +const ionicConfig = { prodMode: true, tabbarLayout: 'title-hide', platforms: { @@ -45,7 +45,7 @@ let ionicConfig = { } }; -let jwtProvider = provide(AuthHttp, { +const jwtProvider = provide(AuthHttp, { useFactory: (http) => { return new AuthHttp(new AuthConfig({ headerName: 'X-Csr-Authorization' @@ -54,13 +54,12 @@ let jwtProvider = provide(AuthHttp, { deps: [Http] }); -let providers = [ +const providers = [ ApiData, AuthService, NotificationService, - jwtProvider + jwtProvider, + provideCloud(cloudSettings) ]; -providers.push(...ionicPlatformProviders(ionicPlatformConfig)); - ionicBootstrap(LustrumApp, providers, ionicConfig); diff --git a/app/services/auth.ts b/app/services/auth.ts index a3c89a2..4a3942b 100644 --- a/app/services/auth.ts +++ b/app/services/auth.ts @@ -3,7 +3,7 @@ import { Headers, Http } from '@angular/http'; import { AuthHttp, JwtHelper, tokenNotExpired } from 'angular2-jwt'; import { LocalStorage, Platform, SqlStorage, Storage } from 'ionic-angular'; import { Observable } from 'rxjs/Rx'; -import { Analytics, Push } from '@ionic/platform-client-angular'; +import { Analytics, Push } from '@ionic/cloud-angular'; import { AppSettings } from '../constants/app-settings'; diff --git a/package.json b/package.json index 4435e02..75bb9c6 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/manduro/onontdekt.git" }, "scripts": { - "build": "gulp --gulpfile test/gulpfile.ts --cwd ./ build-app", + "build": "gulp --gulpfile test/gulpfile.ts --release --cwd ./ build-app", "e2e": "gulp --gulpfile test/gulpfile.ts --cwd ./ build-e2e && protractor test/protractor.conf.js", "karma": "gulp --gulpfile test/gulpfile.ts --cwd ./ karma-debug", "postinstall": "ionic state restore && typings install && webdriver-manager update && cp test/karma-static/*.html node_modules/karma/static", @@ -22,7 +22,7 @@ "@angular/platform-browser": "2.0.0-rc.1", "@angular/platform-browser-dynamic": "2.0.0-rc.1", "@angular/router": "2.0.0-rc.1", - "@ionic/platform-client-angular": "0.0.8", + "@ionic/cloud-angular": "0.0.10", "angular2-jwt": "0.1.16", "es6-shim": "0.35.1", "ionic-angular": "2.0.0-beta.8",