我正在打开.xcworkspace我的Ionic 3项目并尝试在我的设备上运行它,但我突然在Xcode中收到以下错误:
Ld /Users/manuel/Library/Developer/Xcode/DerivedData/MyApp-awaxbzztsgokklgptpuoufwcwmkt/Build/Products/Debug-iphoneos/MyApp.app/MyApp normal arm64
cd /Users/manuel/Documents/MyApp/dev/copernic4-ion2/galilei/platforms/ios
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -L/Users/manuel/Library/Developer/Xcode/DerivedData/MyApp-awaxbzztsgokklgptpuoufwcwmkt/Build/Products/Debug-iphoneos -L/Users/manuel/Documents/MyApp/dev/copernic4-ion2/galilei/platforms/ios/MyApp/Plugins/cordova-plugin-google-analytics -F/Users/manuel/Library/Developer/Xcode/DerivedData/MyApp-awaxbzztsgokklgptpuoufwcwmkt/Build/Products/Debug-iphoneos -F/Users/manuel/Documents/MyApp/dev/copernic4-ion2/galilei/platforms/ios/Pods/OneSignal/iOS_SDK/OneSignalSDK/Framework -FMyApp/Plugins/com.googlemaps.ios -filelist /Users/manuel/Library/Developer/Xcode/DerivedData/MyApp-awaxbzztsgokklgptpuoufwcwmkt/Build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/MyApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/manuel/Library/Developer/Xcode/DerivedData/MyApp-awaxbzztsgokklgptpuoufwcwmkt/Build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/MyApp_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC -ObjC -framework OneSignal -framework SystemConfiguration -framework UIKit -framework UserNotifications /Users/manuel/Library/Developer/Xcode/DerivedData/MyApp-awaxbzztsgokklgptpuoufwcwmkt/Build/Products/Debug-iphoneos/libCordova.a -framework Accelerate -framework CoreData -framework CoreLocation -framework CoreText -framework GLKit -framework ImageIO -lc++ -lz -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -framework GoogleMapsBase -framework GoogleMaps -framework GoogleMapsCore -framework …Run Code Online (Sandbox Code Playgroud) 我正在尝试从我的移动混合应用程序(Ionic 3)向我的Heroku后端(Node.js)发送图片,并让后端将图片上传到Firebase存储,并将新上传的fil下载URL返回到移动应用程序.
请注意,我正在使用适用于Node.js的Firebase Admin SDK.
所以我将base64编码的图像发送到Heroku(我用在线base64解码器检查编码的字符串,它没关系),由以下函数处理:
const uploadPicture = function(base64, postId, uid) {
return new Promise((resolve, reject) => {
if (!base64 || !postId) {
reject("news.provider#uploadPicture - Could not upload picture because at least one param is missing.");
}
let bufferStream = new stream.PassThrough();
bufferStream.end(new Buffer.from(base64, 'base64'));
// Retrieve default storage bucket
let bucket = firebase.storage().bucket();
// Create a reference to the new image file
let file = bucket.file(`/news/${uid}_${postId}.jpg`);
bufferStream.pipe(file.createWriteStream({
metadata: {
contentType: 'image/jpeg'
}
}))
.on('error', error => {
reject(`news.provider#uploadPicture …Run Code Online (Sandbox Code Playgroud) node.js google-cloud-storage google-cloud-platform firebase-storage
我使用Ionic 2构建了一个Angular Reactive Form.
当我触摸页面底部的输入时,页面将滚动,因此输入位于键盘上方.预期的行为,好吧.但是标题也是推,这是错误的.
所以我在互联网上查找了一个解决方法,即在app.module.ts的import语句中编写以下内容
// app.module
IonicModule.forRoot(MyApp, {
scrollAssist: true,
autoFocusAssist: true
})
Run Code Online (Sandbox Code Playgroud)
这确实很有效,因为页面仍然滚动,标题不会被推开.
但我还有一个问题.当我触摸不需要显示键盘的输入(例如,datepicker)时,页面在第一次触摸时滚动,我必须再次触摸,以便日期选择器打开...
关于我怎么可能的任何想法可能会阻止页面在触摸不需要键盘的输入时自动滚动?
突然,当我从 Xcode 构建和运行我的 Ionic 3 应用程序时,我收到了这样的错误,对于所有的cordova 插件:
WARN: Native: tried calling StatusBar.styleDefault, but the StatusBar plugin is not installed.
WARN: Install the StatusBar plugin: 'ionic plugin add cordova-plugin-statusbar'
Run Code Online (Sandbox Code Playgroud)
到目前为止它工作正常,我不明白为什么现在会发生这种情况以及如何补救(重新安装除外)。
即使它们在 package.json 和 config.xml 中都很好地列出。
我在 Heroku 订阅了一个爱好计划。
该计划的详细信息指定它最多允许 10 个过程类型。
所以我开发了一个带有以下 Procfile 的应用程序:
backend-dev: node ./backend-dev/backend.js
backend-prod: node ./backend-prod/backend.js
Run Code Online (Sandbox Code Playgroud)
代表 2 种流程类型,对吗?
但是当我运行它时:
heroku ps:scale backend-dev=1
heroku ps:scale backend-prod=1
Run Code Online (Sandbox Code Playgroud)
我最终得到了两个 Hobby Dynos……由于计划还指定了 7 欧元/月/Dyno,我的费用为 14 欧元/月。
所以我的问题是:
我刚刚升级到 AngularFire2 rc 5.0。
我修改了我的代码,使其与新类型和功能相匹配,但是在尝试订阅 a 时出现以下错误.object(path):
Property 'subscribe' does not exist on type 'AngularFireObject'
Run Code Online (Sandbox Code Playgroud)
我的代码如下。
供应商:
getEvent(id: string): AngularFireObject<any> {
let path = `/events/${id}`;
return this.af.object(path).valueChanges();
}
Run Code Online (Sandbox Code Playgroud)
页:
...
event$: AngularFireObject<any>;
...
// Retrieve event's info
this.event$ = this.eventService.getEvent(this.id);
// Retrieve event's ownership info
let subscription = this.event$.subscribe(event => {
this.owner$ = this.userService.getUserPublicInfo(event.owner);
});
Run Code Online (Sandbox Code Playgroud)
任何的想法?
observable ionic-framework angularfire2 angular angularfire5
我正在尝试使用有角度的材料(也就是说,在图像上添加动态文本)重现以下内容: 图像上的文本
我想用md-cards,因为那里方便。
我的问题是我无法在图像上叠加文字;文本总是在图像之前或之后。
使用 CSS 中的位置是唯一的解决方案吗?
非常感谢!
您知道我可以在哪里查看和管理 FCM 中的主题(排序或管理控制台)吗?
谢谢!
* 更新 * 使用 FCM 科尔多瓦插件 (FCMPlugin),我在我的应用程序中编写了以下内容:
FCMPlugin.getToken(function(token){
console.log('FCMPLUGIN: ', token);
alert(token); // the token pops up in my app
});
FCMPlugin.subscribeToTopic('topics/chats/' + currentUser.auth.uid);
Run Code Online (Sandbox Code Playgroud)
没有错误,一切似乎都正常,但是当我转到通知控制台时,我看不到我的主题:

我在一些文档中读到,向不存在的主题发送消息会创建它,所以我尝试通过 FCMPlugin ( https://cordova-plugin-fcm.appspot.com/ )的测试控制台,但我的主题中仍然没有主题控制台......知道我做错了什么吗?
在Ionic 2中,我试图创建一个动态表单,该表单应显示一个切换按钮列表。
为此,我尝试使用FormArray并依赖于Angular文档,主要是在这篇文章上
基于此,我实现了以下
<form *ngIf="accountForm" [formGroup]="accountForm">
<ion-list>
<!-- Personal info -->
<ion-list-header padding-top>
Informations personnelles
</ion-list-header>
<ion-item>
<ion-label stacked>Prénom</ion-label>
<ion-input formControlName="firstname" [value]="(user | async)?.info.firstname" type="text"></ion-input>
</ion-item>
<!-- Sport info -->
<ion-list-header padding-top>
Mes préférences sportives
</ion-list-header>
<ion-list formArrayName="sports">
<ion-item *ngFor="let sport of accountForm.controls.sports.controls; let i = index" [formGroupName]="i">
<ion-label>{{sport.name | hashtag}}</ion-label>
<ion-toggle formControlName="{{sport.name}}"></ion-toggle>
</ion-item>
</ion-list>
</ion-list>
</form>
Run Code Online (Sandbox Code Playgroud)
控制者
ionViewDidLoad() {
console.log('MyAccountPage#ionViewDidLoad');
// Retrieve the whole sport list
this.sportList$ = this.dbService.getSportList();
this.sportList$.subscribe(list => {
// Build form
let sportFormArr: …Run Code Online (Sandbox Code Playgroud) 我尝试使用Google Places Js API检索Google Places,并使用BehaviorSubject.next通过异步管道更新我的Angular视图,但视图未更新。
实际上,有时15秒后会发生。有时我必须单击某处。但是我确定的是,当我从Google服务器获得结果时,它不会更新...(我将其记录下来)。
这是我的搜索功能:
import { AfterViewInit, Component, ViewChild, ElementRef } from '@angular/core';
import { LoadingController, NavParams, ViewController, Platform } from 'ionic-angular';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
declare var google;
@Component({
selector: 'page-new-location-modal',
templateUrl: 'new-location-modal.html'
})
export class NewLocationModalPage {
@ViewChild('map') map: ElementRef;
// ngModel for segment
googleSearchType: string;
// Sport retrieved from previous page (newEventForm)
sport = '';
// Props used for suggestion func
mapElem: ElementRef;
googleService: any;
places$:BehaviorSubject<any[]>= new BehaviorSubject([]);
constructor(
public platform: Platform,
public viewCtrl: …Run Code Online (Sandbox Code Playgroud) 我想在Ionic 2中构建一个表单,我想在其中显示一个切换列表(每个切换表示一项运动).
从DB我检索的运动列表试图在subscribe()函数中初始化我的表单,但看起来该视图正在抛出错误,因为在解析[formGroup]属性时,该表单尚不存在. ..
在我看来
<form [formGroup]="accountForm">
<ion-list>
<!-- Personal info -->
<ion-list-header padding-top>
Informations personnelles
</ion-list-header>
<ion-item>
<ion-label stacked>Prénom</ion-label>
<ion-input formControlName="firstname" [value]="(user | async)?.info.firstname" type="text"></ion-input>
</ion-item>
<!-- Sport info -->
<ion-list-header padding-top>
Mes préférences sportives
</ion-list-header>
<ion-list formArrayName="sports">
<ion-item *ngFor="let sport of accountForm.controls.sports.controls; let i = index" [formGroupName]="i">
<ion-label>{{sport.name | hashtag}}</ion-label>
<ion-toggle formControlName="{{sport.name}}"></ion-toggle>
</ion-item>
</ion-list>
</ion-list>
</form>
Run Code Online (Sandbox Code Playgroud)
在我的控制器中
ionViewDidLoad() {
console.log('MyAccountPage#ionViewDidLoad');
// Retrieve the whole sport list
this.sportList$ = this.dbService.getSportList();
this.sportList$.subscribe(list => {
// Build form
let sportFormArr: FormArray …Run Code Online (Sandbox Code Playgroud) 我试图根据用户在几个列表中出现的次数来对用户列表进行排名:
function getRegistrationsFromSportList(sportList){
console.info('[DatabaseService-getRegistrationsFromSportList] Getting registrations to sports...');
var promiseHash = {};
sportList.forEach(function (sport){
promiseHash[sport] = firebase.database().ref('/sport_registrations/' + sport).once('value');
});
return $q.all(promiseHash);
}
getUserSportListPromise(user.uid).then(function(sportList){
return getRegistrationsFromSportList(sportList);
})
.then(function(registrationsHash){
console.info('[DatabaseService-getMatches] Processing matches...');
var matches = [];
angular.forEach(registrationsHash, function(regsSnap, sport){
console.dir(regsSnap.val());
regsSnap.forEach(function(user){
if (matches.indexOf(user.key) > -1) {
matches[user.key]++;
} else{
matches[user.key] = 1;
}
console.dir(matches);
});
});
});
}
Run Code Online (Sandbox Code Playgroud)
这是我的控制台日志:
Object
e8wXuTklnVcYknc0MYn34xlcqmA3: true
Array[0]
Lvwr4lkZ58SnhrZzft6FhT08iVN2: 1
ND9iZYJ3gfQUvjKSRaKKc8NEkAj2: 1
SA0h1iHwyCSeytgh6FOglSf1sOs2: 1
e8wXuTklnVcYknc0MYn34xlcqmA3: 1
Object
Lvwr4lkZ58SnhrZzft6FhT08iVN2: true
ND9iZYJ3gfQUvjKSRaKKc8NEkAj2: true
SA0h1iHwyCSeytgh6FOglSf1sOs2: true
e8wXuTklnVcYknc0MYn34xlcqmA3: true
Array[0] …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的应用中实现聊天。
我写了一个 autosizing ion-textarea 如下:查看
<ion-footer [keyboardAttach]="content">
<ion-toolbar class="text-input">
<ion-item no-lines>
<ion-textarea autosize
rows="1"
placeholder="Votre message..."
autocomplete="on"
autocorrect="on"
[(ngModel)]="message"
>
</ion-textarea>
<button ion-button small icon-only round item-end color="secondary" (tap)="onSend()">
<ion-icon name="send"></ion-icon>
</button>
</ion-item>
</ion-toolbar>
</ion-footer>
Run Code Online (Sandbox Code Playgroud)
CSS
ion-footer {
ion-toolbar.toolbar.toolbar-ios {
&.toolbar:last-child {
padding-bottom: 0px;
height: auto;
}
}
ion-item.item-textarea {
background-color: transparent;
}
.text-input {
height: auto;
div.input-wrapper {
background-color: #fff;
border-radius: 20px;
textarea.text-input {
margin-left: 8px;
max-height: 100px;
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
指示
import {ElementRef, HostListener, Directive, OnInit, ViewChild} …Run Code Online (Sandbox Code Playgroud) ionic2 ×6
angular ×4
ionic3 ×3
angularjs ×2
cordova ×2
css ×2
javascript ×2
observable ×2
angularfire2 ×1
angularfire5 ×1
firebase ×1
heroku ×1
heroku-cli ×1
node.js ×1
textarea ×1
typescript ×1
xcode ×1