我有两个 Ionic 应用程序。我有一个我不久前提交的就好了。现在,当我在另一个应用程序上提交构建时,我不断收到此错误。
Missing Push Notification Entitlement - Your app appears to include API
used to register with the Apple Push Notification service, but the app
signature's entitlements do not include the "aps-environment"
entitlement. If your app uses the Apple Push Notification service, make
sure your App ID is enabled for Push Notification in the Provisioning
Portal, and resubmit after signing your app with a Distribution
provisioning profile that includes the "aps-environment" entitlement.
See "Provisioning and Development" in the Local …Run Code Online (Sandbox Code Playgroud) 在离子中,我如何在底部离子含量的某个百分比处放置一个按钮?
我试过了
<ion-view>
<ion-content>
<div class="button-bottom">
<button class="button button-block button-energized">Button</button>
</div>
</ion-content>
</ion-view>
Run Code Online (Sandbox Code Playgroud)
css:
.button-bottom{
position: absolute;
bottom: 30%;
}
Run Code Online (Sandbox Code Playgroud)
但按钮现在没有全宽。
我在我的应用程序中加载 socket.io,如下所示:
index.html
<script src="http://myapp.com/socket.io/socket.io.js"></script>
...
// Angular stuff
Run Code Online (Sandbox Code Playgroud)
我有一个Socket需要window.io工作的组件。
import { Injectable } from '@angular/core';
import { Events } from 'ionic-angular';
@Injectable()
export class Socket {
public isConnected: boolean = false;
constructor(public events: Events) {
if (typeof window.io === "undefined") {
throw new Error("Socket.io is undefined.");
}
this.io = window.io;
}
connect() {
this.io.connect("...");
}
listen() {
}
}
Run Code Online (Sandbox Code Playgroud)
从理论上讲,它可能有效(未测试),但将窗口范围内的内容注入类并不是一个好习惯。
有没有办法做到这一点:
import { SocketIODriver } from 'socket.io';
import { Socket } from 'App/Socket/Socket';
@Component({
templateUrl: …Run Code Online (Sandbox Code Playgroud) 我看到 Ionic 2 上有一个 Native Storage,但我没有看到 Ionic 1 的 Native Storage,我不确定是我错过了它,还是它不存在。
我知道 Sql lite 和其他类似的解决方案,但如果我们不需要它,我希望避免将其添加到我们的应用程序中,因为我们最终将转向 Ionic 2,但我们有对持久存储的迫切需求。
我在 ionic 2 项目中工作,创建滑动以删除每个工作正常的项目,还需要单击按钮删除所有项目如何从 angular 2 的列表中删除所有项目?
<button ion-button clear>Clear All</button>
<ion-item-sliding *ngFor="let note of notes">
<ion-item>
{{note.title}}
</ion-item>
<ion-item-options>
<button (click)="deleteNote(note)" danger>
<ion-icon name="trash"></ion-icon>
</button>
</ion-item-options>
</ion-item-sliding>
Run Code Online (Sandbox Code Playgroud)
文件.ts
constructor( public viewCtrl: ViewController ) {
this.notes = [
{ title: 'This is notification swipe to delete' },
{ title: 'This is notification swipe to delete' }
];
}
deleteNote(note){
let index = this.notes.indexOf(note);
if(index > -1){
this.notes.splice(index, 1);
}
}
Run Code Online (Sandbox Code Playgroud) 我在 Ionic 上开发了一个项目。
在一个视图中,我搜索了捏缩放图片的可能性。
我试过hammer.js(http://hammerjs.github.io/)。捏合缩放有效,但缩放在图片的中心屏幕上,而不是在执行捏合的位置。另外,图片可能会从屏幕上消失......
那么,我如何在具有 Android/Ios 兼容性的图片(而不是画廊)上进行缩放。这是一个基本功能,它不是很受欢迎......
任何想法或教程?
我正在使用插件(dom-to-image)从 div 生成 SVG 内容。它返回一个像这样的 dataURL:
data image/xml, charset utf-8, <svg...
Run Code Online (Sandbox Code Playgroud)
如果把这个放在一个<img src图像上,它会正常显示。
目的是获取此 dataURL,将其转换为 base64,以便我可以将其保存为移动应用程序上的 image.png。
是否可以?
我尝试了这个解决方案/sf/answers/1991561561/ 但无法开始工作。控制台触发有关 dataUrl 的错误
类型错误:无法在“XMLSerializer”上执行“serializeToString”:参数 1 不是“节点”类型。
==== 更新 :: 问题说明/历史 ====
我正在使用 Ionic 框架,所以我的项目是一个移动应用程序。dom-to-image 现在已经开始工作了,它通过toPng函数渲染了一个 PNG 。问题是光栅PNG是模糊的。
所以我想:也许 SVG 的质量会更好。它是!!实际上,它是 100% 完美的。
在 Ionic 上,我使用两步程序来保存图像。得到dom-to-img(base64) dataURL生成的PNG后,我将其转换为Blob,然后保存到设备中。这是有效的,但正如我所说,最终结果是模糊的。
然后使用 SVG 也许它会更“高质量”。
因此,为了对已经在工作的进程进行“最小”更改:DI 只需要将 SVG 转换为 base64 dataURL ....
或者,正如你们中的一些人向我解释的那样,进入其他东西,比如画布......我不太了解:/
===
很抱歉发表这么长的帖子,我真的非常感谢你们的帮助!!
我有一个使用 Ionic.io 推送消息的 Ionic 项目。它使用 Fastlane 构建并通过 HockeyApp 部署。
由于升级到 Xcode 8 推送通知不再适用于 iOS 10。
我有一个包含推送授权的授权文件,它使用 ruby 脚本添加到 xcode 项目文件中,请参阅https://github.com/fastlane/fastlane/issues/6544
当我使用 Fastlane push 构建项目时,仍然无法正常工作。当我在 Xcode 中打开项目文件并查看功能部分时,它在“将推送通知权利添加到您的权利文件”中显示了一个复选标记,但在“将推送通知功能添加到您的应用程序 ID”中显示了一个错误。
如果我按“修复”并重建, push确实有效。
所以我的问题是:
我希望能够正确启用推送功能,只使用 Fastlane、xcodebuild、ruby 或其他任何东西,只要它仅在命令行中并允许我的 ionic 项目干净地构建。
运行ionic serve显示以下消息。但是,我在 azure 中有一个 facebook 登录名,而 CORS 只接受localhost. 有没有办法将IP地址更改为localhost?
Running live reload server: http://192.168.0.5:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
? Running dev server: http://192.168.0.5:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown …Run Code Online (Sandbox Code Playgroud)