我正在使用离子技术开发混合应用程序。我想使用离子本机文件打开工具插件从设备内部或外部存储打开(doc,ppt,xlsx,pdf,jpg,png)文件,但我只能使用以下代码打开pdf文件。我使用application / pdf打开pdf,打开其他文件我应该在application / pdf处替换什么?请帮我。谢谢。
import { FileOpener } from '@ionic-native/file-opener';
constructor(private fileOpener: FileOpener) { }
...
this.fileOpener.open('path/to/file.pdf', 'application/pdf')
.then(() => console.log('File is opened'))
.catch(e => console.log('Error openening file', e));
Run Code Online (Sandbox Code Playgroud) 我正在开发ionic capacitor具有 firebase 电话身份验证功能的应用程序。我已遵循 firebase 文档,并将代码设置为身份验证电话,并使用 firebase 发送 otp 和验证。它在浏览器和 Android 设备中运行良好。我正在获取 otp,我也可以验证它,但现在我正在创建 ios 构建并发现我遇到了一些错误
code: "auth/operation-not-supported-in-this-environment"
message: "RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment."
Run Code Online (Sandbox Code Playgroud)
请在下面找到我的代码
recaptchaVerifier: firebase.auth.RecaptchaVerifier;
ionViewDidLoad() {
this.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('sign-in-button', {
size: 'invisible',
callback: (response) => {
},
'expired-callback': () => {
}
});
}
signInWithPhoneNumber() {
this.authService.signInWithPhoneNumber(this.recaptchaVerifier, +19898989898).then(
success => {
this.verifyPhone();
}).catch(error => this.afterLoginError(error));
}
Run Code Online (Sandbox Code Playgroud)
所以问题只出在ios上
javascript firebase firebase-authentication capacitor ionic5
我正在使用ionic-4. 我有简单的搜索页面,我想将搜索图标移动到组件的右侧ion-searchbar。我尝试过使用不同的CSS规则,但没有找到任何解决方案。
我的离子搜索栏代码如下:
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-searchbar showCancelButton="never"></ion-searchbar>
</ion-toolbar>
</ion-header>
Run Code Online (Sandbox Code Playgroud)
我正在开发在 ubantu 中Hybrid使用的应用程序ionic-2。我想在我的应用程序中添加 Facebook 登录但安装 Facebook 插件应用程序构建失败如果我删除 Facebook 插件应用程序将成功构建请帮助我。谢谢你。
我安装的插件
ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"
Run Code Online (Sandbox Code Playgroud)
错误信息
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 17s
FAILED
25 actionable tasks: …Run Code Online (Sandbox Code Playgroud)