我尝试使用推送通知构建离子3应用程序,我在iOS部署时遇到了一些问题.
我在xcode中有这3个错误:
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Run Code Online (Sandbox Code Playgroud)
我尝试了很多在互联网上找到的解决方案:
使用命令"pod install","pod update"
删除并安装CocoaPods
更新CocoaPods
删除"Pods"文件夹,"Podfile.lock"和"Podfile"并运行"pod install"命令.
从Link Binary From Librairies中删除libPods-myApp.a.
但没有什么是有效的......
我真的不知道自己要做什么.
我的Podfile:
# DO NOT MODIFY -- auto-generated by Apache Cordova
platform :ios, '8.0'
target 'MyProject' do
project 'MyProject.xcodeproj'
pod 'GoogleCloudMessaging', '~> 1.2.0'
pod 'GGLInstanceID', '~> 1.2.1'
end
Run Code Online (Sandbox Code Playgroud)
我的Podfile.lock:
PODS:
- GGLInstanceID (1.2.1) …Run Code Online (Sandbox Code Playgroud) 我使用Ionic 2,我希望我的应用程序在关闭应用程序时执行一些任务.像Gmail一样继续通知的东西.
我找到了这个:https: 0000-00-00ionicframework.com/docs/v2/native/background-mode/
但是我想用在后台运行的特定方法创建一个特定的服务.这个插件所有应用程序都在后台运行.
有人可以解释我该怎么做?
我在我的应用程序中使用离子标签,我想在标签按钮中使用图片.我想动态地设置这张照片.
在我的情况下,我有一个帐户与不同的用户链接.我想根据所选用户更改我的标签图片.
我有这个 :
我想要这个:
我的标签中的代码:
<ion-tabs tabsHighlight="false">
<ion-tab [root]="HomePage"
tabsHideOnSubPages="true"
tabIcon="checkbox"
tabTitle="A faire"
tabBadge="5"
tabBadgeStyle="notif">
</ion-tab>
<ion-tab [root]="ToComePage"
tabsHideOnSubPages="true"
tabIcon="time" tabTitle="A venir"
tabBadge="0"
tabBadgeStyle="notif">
</ion-tab>
<ion-tab [root]="HistoricPage"
tabsHideOnSubPages="true"
tabIcon="book"
tabTitle="Historique">
</ion-tab>
<ion-tab [root]="MenuPage"
tabsHideOnSubPages="true"
//I want to delete this tab Icon and replace it by a picture.
tabIcon="menu"
tabTitle="Menu">
</ion-tab>
</ion-tabs>
Run Code Online (Sandbox Code Playgroud)
我不知道怎么做,这个想法?
我使用这个插件有本地通知:https: //github.com/katzer/cordova-plugin-local-notifications/wiki/03.-Installation
我希望在通知中有一个特定的图标.它位于我的/ www/assets/images /文件夹中.
我尝试这种方式,但它不起作用,我有一个带铃铛的方形图标:
public schedule() {
cordova.plugins.notification.local.schedule({
title: "New Message",
message: "Hi, are you ready? We are waiting.",
sound: null,
at: new Date(new Date().getTime() + 5 * 1000),
icon: 'file://assets/images/logo2.png'
});
}
Run Code Online (Sandbox Code Playgroud)
有人可以告诉我我必须写的路径类型吗?我迷路了.
我尝试第一次在Testflight上部署我的Ionic 3应用程序.
但当我运行我的命令时:"sudo fastlane beta"我总是有这个错误:
Check dependencies
Code Signing Error: No profile for team '(TEAM_ID)' matching 'match AppStore (APP_BUNDLE)' found: Xcode couldn't find any provisioning profiles matching '(TEAM_ID)/match AppStore (APP_BUNDLE)'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1'
** ARCHIVE FAILED **
Run Code Online (Sandbox Code Playgroud)
我真的不知道我要做些什么来解决这个问题.
我做了什么 :
首先,我按照这个来生成我的证书和我的个人资料
https://codesigning.guide/
我没有问题.我可以在我的帐户开发者iOS上看到我的个人资料. …
我尝试在.ts文件中设置一个间隔,但我不明白如何在间隔中的同一文件中使用一个函数.
解释 :
我的间隔设置:
this.task = setInterval(function () {
this.refreshData();
}, 300);
Run Code Online (Sandbox Code Playgroud)
我的功能在同一个ts文件中:
refreshData() : void{
console.log('update...');
}
Run Code Online (Sandbox Code Playgroud)
当我在我的设备上运行时,我有这个错误:
04-19 10:38:57.535 21374-21374/com.ionicframework.app722890 I/chromium: [INFO:CONSOLE(79432)] "TypeError: this.refreshData is not a function
at file:///android_asset/www/build/main.js:10987:18
at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:10284)
at Object.onInvokeTask (file:///android_asset/www/build/main.js:39626:37)
at t.invokeTask (file:///android_asset/www/build/polyfills.js:3:10220)
at e.runTask (file:///android_asset/www/build/polyfills.js:3:7637)
at invoke (file:///android_asset/www/build/polyfills.js:3:11397)
at e.args.(anonymous function) (file:///android_asset/www/build/polyfills.js:2:30193)", source: file:///android_asset/www/build/main.js (79432)
Run Code Online (Sandbox Code Playgroud)
我尝试这种方式,但我不工作:
this.task = setInterval(this.refreshData(), 300);
Run Code Online (Sandbox Code Playgroud)
这只调用我的函数一次.
有人有想法吗?
我正在尝试在 iOS 中构建一个带有推送通知的 Ionic 2 应用程序。
我使用以下命令行添加了 Phonegap 插件推送通知:
cordova plugin add phonegap-plugin-push --variable SENDER_ID=12341234 --save
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在设备中运行我的项目时,我在 xcode 中出现此错误:
"GoogleCloudMessaging.h" file not found
Run Code Online (Sandbox Code Playgroud)
我寻找了一个解决方案,我已经安装了 Cocoapods。我删除了平台 iOS 并尝试使用以下命令行添加它:
sudo ionic platform add ios
Run Code Online (Sandbox Code Playgroud)
我有这个错误:
Installing "phonegap-plugin-push" for ios
Failed to install 'phonegap-plugin-push':undefined
Error: /Library/Ruby/Gems/2.0.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
+ cache Manipulate the CocoaPods cache
+ env Display pod environment
+ init Generate a …Run Code Online (Sandbox Code Playgroud) 我尝试在我的Ionic App中覆盖手机的后退按钮.
如果我不在页面中,此代码允许我打开模式以关闭应用程序,否则关闭页面.
但这不允许我关闭一个打开的模态.如何检测我是否处于模态中以关闭它?
platform.registerBackButtonAction(() => {
let nav = app.getActiveNav();
let activeView: ViewController = nav.getActive();
console.log(activeView);
if(activeView != null){
if(nav.canGoBack()) {
activeView.dismiss();
} else{
let alert = this.alertCtrl.create({
title: this.pdataManager.translate.get("close-app"),
message: this.pdataManager.translate.get("sure-want-leave"),
buttons: [
{
text: this.pdataManager.translate.get("no"),
handler: () => {
this.presentedAlert = false;
},
role: 'cancel',
},
{
text: this.pdataManager.translate.get("yes"),
handler: () => {
this.presentedAlert = false;
this.platform.exitApp();
}
}
]
});
if(!this.presentedAlert) {
alert.present();
this.presentedAlert = true;
}
}
}
});
}
Run Code Online (Sandbox Code Playgroud) 我想改变我的classe元素,但我不知道如何处理Ionic 2.我试过这种方式,但这是错的:
<span [ngClass]="{(user.id == this.session.userDefaultId) : 'class1 class2', (user.id != this.session.userDefaultId) : 'class3 class4'}">
...
</span>
Run Code Online (Sandbox Code Playgroud)
有人可以解释我怎么做那样的想法吗?:)
我尝试在我的应用中隐藏所有子页面上的标签.我用这个:
<ion-tab [root]="MyPage" tabsHideOnSubPages="true" ...></ion-tab>
Run Code Online (Sandbox Code Playgroud)
当我运行离子发球; 这是工作.但是当我尝试在我的设备上运行它时,我的标签不会隐藏在子页面中,我也无法使用它.
有人有想法最终隐藏我的设备中的标签?
[更新]在我的子页面中,我有一个谷歌地图.如果我删除它,我就不再有问题了.
子页面.html:
<ion-header>
<c-header></c-header>
</ion-header>
<ion-content>
<div id="map"></div>
</ion-content>
Run Code Online (Sandbox Code Playgroud)
子页面.css:
#map {
height: 50%;
}
Run Code Online (Sandbox Code Playgroud)
子页面.ts:
import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { GoogleMap, GoogleMapsEvent, GoogleMapsLatLng } from 'ionic-native';
/*
Generated class for the DetailsMedicalEvent page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-details-medical-event',
templateUrl: 'details-medical-event.html'
})
export class DetailsMedicalEventPage {
map: GoogleMap;
constructor(public navCtrl: NavController, public platform: …Run Code Online (Sandbox Code Playgroud) 我尝试在 iOS 上构建一个带有推送通知的 Ionic 3 应用程序。
请参阅这篇文章: Ionic 3 - cocoapods 的 xcode 错误
我有树错误:
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Run Code Online (Sandbox Code Playgroud)
我试图解决它在我的 [CP] Check Pods Manifest.lock 中购买此修改:
diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with …Run Code Online (Sandbox Code Playgroud) 我尝试在我的Ionic 2应用程序中使用它:https: //ionicframework.com/docs/v2/storage/
我已经跑了
cordova plugin add cordova-sqlite-storage --save
Run Code Online (Sandbox Code Playgroud)
和
npm install --save @ionic/storage
Run Code Online (Sandbox Code Playgroud)
成功.
当我尝试在app.module.ts中添加存储时,我遇到了这个错误:
Error: Can't resolve all parameters for Storage: (?).
at v (http://localhost:8100/build/polyfills.js:3:4864)
at SyntaxError.BaseError [as constructor] (http://localhost:8100/build/main.js:127193:27)
at new SyntaxError (http://localhost:8100/build/main.js:11660:16)
at CompileMetadataResolver._getDependenciesMetadata (http://localhost:8100/build/main.js:27183:31)
at CompileMetadataResolver._getTypeMetadata (http://localhost:8100/build/main.js:27058:26)
at CompileMetadataResolver._getInjectableMetadata (http://localhost:8100/build/main.js:27046:21)
at CompileMetadataResolver.getProviderMetadata (http://localhost:8100/build/main.js:27288:40)
at http://localhost:8100/build/main.js:27246:49
at Array.forEach (native)
at CompileMetadataResolver._getProvidersMetadata (http://localhost:8100/build/main.js:27213:19)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/main.js:26897:50)
at JitCompiler._loadModules (http://localhost:8100/build/main.js:72991:64)
at JitCompiler._compileModuleAndComponents (http://localhost:8100/build/main.js:72951:52)
at JitCompiler.compileModuleAsync (http://localhost:8100/build/main.js:72917:21)
at PlatformRef_._bootstrapModuleWithZone (http://localhost:8100/build/main.js:52753:25)
Run Code Online (Sandbox Code Playgroud)
我不明白我该如何解决它.
我的app.module.ts:
import { Storage } from …Run Code Online (Sandbox Code Playgroud)