ionic2 PhotoViewer local file

https://ionicframework.com/docs/v2/native/photo-viewer/ follow step just do. Now focus https://github.com/sarriaroman/photoviewer/issues/11 ps: declare var cordova: any; ps2: cordova plugin add cordova-plugin-file www/assets/img is ionic2 now version, maybe future change, but now this is correct showImage(imageUrl) { if (this.platform.is(‘cordova’) && this.platform.is(‘android’)) { File.readAsDataURL(cordova.file.applicationDirectory + “www/assets/img/”, imageUrl) .then((dataURL:string) => { PhotoViewer.show(dataURL, “”, {share: false}) }) .catch( (err)=>{alert(“err: “+err) }); } else if (this.platform.is(‘cordova’) && this.platform.is(‘ios’)) { PhotoViewer.show(cordova.file.applicationDirectory + “www/assets/img/"+imageUrl); } } https://github.com/apache/cordova-plugin-file ========== https://www.npmjs.com/package/ionic-img-viewer

2017-02-07 · 1 min · 69 words · Me

this.app can't find in app

import { App } from ‘ionic-angular’;

2017-02-07 · 1 min · 6 words · Me

angularfire2 subscribe once

https://github.com/angular/angularfire2/issues/380 subscription.unsubscribe(); Observable.interval + take(1)

2017-01-26 · 1 min · 5 words · Me

copy keep angularfire list

Maybe Object.assign but sub itme only reference So JSON.parse(JSON.stringify(theObject))

2017-01-26 · 1 min · 9 words · Me

ionic2 FCM send message to device token

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”:{ ...

2017-01-22 · 1 min · 131 words · Me