我试过了\n 和 <br />,但遗憾的是没有工作!
这可能吗 ?
//Displaying toast to welcome user!
let user = this.currentUser();
//console.log(user);
let toast = Toast.create({
message: 'Hi ' + user.email + '! <br/> Welcome to My App',
duration: 5000,
position: 'bottom'
});
toast.onDismiss(() => {
console.log('Dismissed toast');
});
this.nav.present(toast);Run Code Online (Sandbox Code Playgroud)
我正在尝试通过 Android Studio 将我的 Ionic Angular 应用程序发布到 Google Play 商店,但在生成 Android 应用程序包时遇到问题。
当我在 Android Studio 中打开应用程序时,我会转到Build>Generate Signed Bundle / APK
下面的 3 个屏幕截图显示了我输入的值。
屏幕一:
屏幕二:
屏幕三:
但是当我单击 时Finish,没有显示任何提示、错误消息等来表明捆绑包是否已创建。
当我转到 时android/app,没有release出现文件夹。
有人可以告诉我为什么如果未创建文件夹则不会出现错误消息吗?
我尝试为我的 Ionic 应用程序构建图像缓存服务。
<ion-col [routerLink]="['/category-detail',cat.objectId,i]" class="category-item"
*ngFor="let cat of categories;index as i" size="3">
<ion-img class="cat-image" [src]="getImage(cat.image.url) | async">
</ion-img>
<p class="cat-name">
{{cat.name}}
</p>
</ion-col>
Run Code Online (Sandbox Code Playgroud)
我从 ion-image 中的 src 标签调用该函数
async getImage(fileUrl: any) {
return await this.cacheService.checkFile(fileUrl);
}
Run Code Online (Sandbox Code Playgroud)
该函数检查文件是否存在,返回文件的 URL,否则返回参数中的 URL
public async checkFile(fileUrl) {
let stringURL = String(fileUrl);
let fileName = stringURL.split('//')[1].replace(/\//g, '-');
return this.file.checkFile(this.file.tempDirectory, fileName)
.then(
async result => {
if (result) {
return this.file.tempDirectory + fileName;
} else {
return fileUrl;
}
}
)
.catch(
async err => …Run Code Online (Sandbox Code Playgroud) 我只想知道我的 Ionic 5 应用程序是否在浏览器中运行,或者在已编译应用程序的 Web 视图中运行。
平台不起作用: https: //ionicframework.com/docs/angular/platform
它只是讲述设备。但是当我在 Android 设备上的 chrome 中运行它时,它返回与我运行编译时相同的平台。
分析 URL以检查 webview url 是否有效,但在使用电容器实时重新加载时无效。因为它与浏览器中本地的 URL 相同。顺便说一句,分析 URL 感觉像是一个丑陋的解决方案。
获得这些简单而重要的信息真的那么困难吗,还是我只是错过了一些东西?
编辑:
Ubuntu 中的
平台输出
Chrome 与 ionic 服务:[“desktop”]
Android 中的 Chrome:[“android”、“mobile”、“mobileweb”]
Android 与电容器 livereload:[“android”、“phablet”、“mobile” , "mobileweb"]
Android 编译:["android", "phablet", "cordova", "capacitor", "mobile", "hybrid"]
我想使用离子存储(基于角度),所以我做了这里描述的所有操作: https: //ionicframework.com/docs/v3/storage/并像这样导入它:
import { IonicStorageModule } from '@ionic/storage';
Run Code Online (Sandbox Code Playgroud)
但我收到此错误:
export 'IonicStorageModule' was not found in '@ionic/storage'
Run Code Online (Sandbox Code Playgroud)
我的离子版本是6.13.1。
我正在尝试为 Android 编译我的第一个带有电容器的离子应用程序。Gradle 成功构建了它,但是当我尝试在 android studio 上运行它时,我收到此错误:
Failed to query the value of task ':capacitor-android:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
Run Code Online (Sandbox Code Playgroud)
查询map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory,fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory))的映射值$FixedDirectory, C:\jsprojects\ajoopay2\node_modules@capacitor\android\capacitor\build\ generated\ap_ generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@482d6451) 在任务'之前:电容器-android:不支持compileDebugJavaWithJavac'已完成
我不知道该怎么做,我花了几个小时试图纠正这个问题,请帮助我
您好,我的应用程序在添加基于角色的身份验证的身份验证服务后遇到此错误“数据库未创建。必须首先调用 create()”。
我可以知道解决吗?
core.js:6456 ERROR Error: Database not created. Must call create() first
at Storage.assertDb (index.js:64)
at Storage.set (index.js:84)
at AuthService.login (auth.service.ts:35)
at LoginPage.login (login.page.ts:54)
at LoginPage_Template_ion_button_click_19_listener (template.html:45)
at executeListenerWithErrorHandling (core.js:15285)
at wrapListenerIn_markDirtyAndPreventDefault (core.js:15323)
at HTMLElement.<anonymous> (platform-browser.js:560)
at ZoneDelegate.invokeTask (zone.js:434)
at Object.onInvokeTask (core.js:28661)
Run Code Online (Sandbox Code Playgroud) 如何在 ionic cli 中使用 pnpm 或 Bun 代替 npm?与 npm 相比,它有一些好的好处,比如较小的存储使用量、下载某些包时显示进度等等......
我有一个在 Android 上运行良好的动态链接,但我无法让 App Store 重定向行为在 iOS 上正常运行。
如果我设置动态链接以转到某个网址(而不是应用程序商店),如果未安装该应用程序,它将按预期工作并打开该应用程序。这是动态链接:
但是,如果我将其设置为在未安装应用程序的情况下转到应用程序商店,即使安装了应用程序,它也始终会转到应用程序商店。
我显然做错了什么或者误解了深层链接和动态链接之间的关系。“go”是我的动态链接子域,“member”是我的深层链接子域。
我意识到还有其他几个问题,但没有一个答案对我有帮助。
其他信息
我使用的是装有 iOS 15.4.1 的实体 iPhone 8
这是我的深层链接,如果我单击设备上的网址,效果很好: https://member.xxxxx.app
我在这里设置了一个应用程序关联文件: https: //member.xxxxx.app/.well-known/apple-app-site-association 我也在这里设置了它,因为我不确定是否要设置它动态链接: https://go.xxxxx.app/.well-known/apple-app-site-association
我在 Xcode 中设置了以下关联域: applinks:member.xxxxx.app 请注意,我没有添加关联域 applinks:go.xxxxx.app,因为这似乎只是使动态链接被视为深层链接。
我在 Apple 开发者标识符中打开了与域相关的功能。
我的应用程序已发布到应用程序商店,但不是具有关联域member.xxxxx.app 的应用程序的最新版本。
我已将我的应用程序和团队 ID 添加到 ios 应用程序上的 Firebase。
我在 iPhone 的开发者设置中打开了“关联域开发”。
我在 info.plist 中添加了 FirebaseDynamicLinksCustomDomains,如下所述: https://firebase.google.com/docs/dynamic-links/custom-domains#set_up_a_custom_domain_in_the
ios firebase ionic-framework firebase-dynamic-links capacitor
我有一个有角度的项目,我想在移动设备上使用 ionic。我做到了ionic init。
当我运行命令时ionic serve,我收到此错误:
> ng.cmd run app:serve --host=localhost --port=8100
[ng] Error: Unknown arguments: host, port
[ERROR] ng has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details.
Run Code Online (Sandbox Code Playgroud)
这是我的package.json:
> ng.cmd run app:serve --host=localhost --port=8100
[ng] Error: Unknown arguments: host, port
[ERROR] ng has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details.
Run Code Online (Sandbox Code Playgroud)
如何修复主机/端口缺少参数?
ionic-framework ×10
capacitor ×4
android ×2
angular ×2
firebase ×2
angular-cli ×1
async-await ×1
ionic-cli ×1
ionic2 ×1
ionic5 ×1
ios ×1
observable ×1
pnpm ×1
typescript ×1