angularfire2 subscribe once
https://github.com/angular/angularfire2/issues/380 subscription.unsubscribe(); Observable.interval + take(1)
https://github.com/angular/angularfire2/issues/380 subscription.unsubscribe(); Observable.interval + take(1)
Maybe Object.assign but sub itme only reference So JSON.parse(JSON.stringify(theObject))
https://www.microsoft.com/en-us/download/details.aspx?id=50042
1、ionic start sendnotify blank –v2 2、cordova plugin add cordova-plugin-whitelist 3、src/index.html 4、ionic serve ====if success===== 5、home.ts add import { Http, Headers, RequestOptions } from ‘@angular/http’; import ‘rxjs/add/operator/map’; add constructor(private http: Http sendnotify_devicetoken(devictoken) { let url = ‘https://fcm.googleapis.com/fcm/send'; let headers = new Headers({ ‘Content-Type’: ‘application/json’, ‘Authorization’: ‘key=your key’ }); let options = new RequestOptions({ headers: headers }); let body = { “notification”:{ ...
https://github.com/fechanique/cordova-plugin-fcm 1、 ionic start getdevicetoken blank –v2 2、ionic plugin add cordova-plugin-fcm –save 3、 firebase console -> project setting -> add your project a. package name: copy from config.xml id=“com.ionicframework.getdevicetokenxxxxxx” b. add project then download google-services.json 4、put google-services.json on getdevicetoken directory, don’t put getdevicetoken/platforms/android or …./ios 5、ionic run android ( remeber open android emule) =====If success, contiune===== 6、src/pages/home a. home.html replace <ion-content <ion-textarea rows=“6” [value]=“devicetoken”> <button ion-button (click)=“getdevicetoken()"> getdevicetokens <button ion-button (click)=“showdevicetoken()"> showdevicetoken <button ion-button (click)=“Notification()"> Notification ...