小编hes*_*wky的帖子

Flutter oneSignal 通知图标未设置

我在我的 flutter 应用程序中使用一个信号,除了通知没有图标(带有默认账单图标)之外,一切都很好。

我已阅读一个信号的文档,并通过Android Studio生成了一个带有名称的AssetsImagePROJECT/android/res/ic_stat_onesignal_default

然后我在真实设备上使用该命令构建了应用程序flutter run --release,但通知仍然带有默认的帐单图标而不是我的应用程序图标!

AndroidManifest.xml文件中是否也需要一些代码?

notifications android dart onesignal flutter

6
推荐指数
1
解决办法
4610
查看次数

如何以编程方式将 ionic 4 中的目录从 LTR 更改为 RTL

我正在开发 ionic 4 多语言应用程序英语和阿拉伯语,所以当用户在语言之间切换时,我需要更改布局!

我在 ionic 3的事件platform.setDir('rtl')中这样做onChangLang

    if (languageId === 'ar') {
      this.platform.setDir('rtl', true);
      this.translate.setDefaultLang(languageId);

    } else {
      this.platform.setDir('ltr', true);
      this.translate.setDefaultLang(languageId);
    }
Run Code Online (Sandbox Code Playgroud)

现在在 ionic 4 中,platform.setDir()出于某种原因已被弃用(删除),并且文档不包含任何替代platform.setDir()或如何以dir编程方式更改!

所以我的问题是如何使用 typescript 以编程方式更改布局方向,就像在 ionic 3 上一样?!

javascript ionic-framework angular ionic4

5
推荐指数
1
解决办法
2834
查看次数

Firebase extraUserInfo.isNewUser 始终返回 false

我将 ionic 4 与 firebase/angularfire2 结合使用并使用signinwithemeailandpassword()方法进行身份验证,因此我需要在注册后检查用户第一次登录的时间,因此我发现 firebase 提供了该选项isNewUser

createUserWithEmailAndPassword()因此,使用isNewUser创建帐户时equal应该true是正常的!signinwithemeailandpassword()但是,无论是第一次登录还是第一次登录,登录时总是返回 false!

这是登录方法的代码:

 async login(form: NgForm) {

// checking if login is valid
if (form.invalid)
  return this.statusMessage.message('Validation error!');

console.log(this.user);

try {

  const results = await this._afAuth.auth.signInWithEmailAndPassword(this.user.email, this.user.password).then(
    user => console.log(user.additionalUserInfo.isNewUser)

  );
  // console.log(results);

} catch (error) {
  switch (error.code) {
    case "auth/user-not-found":
      this.statusMessage.message("Your email address is wrong! please try again");
      break;

    case "auth/invalid-email":
      this.statusMessage.message("You have enterd invalid email address");
      break;

    case "auth/wrong-password": …
Run Code Online (Sandbox Code Playgroud)

firebase typescript ionic-framework firebase-authentication angularfire2

4
推荐指数
1
解决办法
6636
查看次数

Flutter:将整个应用程序的默认 textDirection 更改为 RTL

我正在使用 flutter 构建一个基于阿拉伯语的应用程序(RTL 语言),我想有一种比Directionality在每个页面中使用更好的方法Directionality(textDirection: TextDirection.rtl, child: FacultyPage()),因为我不认为这是一种干净的方法,有时我忘记实现Directionality为父小部件,特别是在具有大量页面/屏幕的大型应用程序。

因此默认布局变为 RTL,无需在每个屏幕/页面上重做Directionality

dart flutter flutter-layout

4
推荐指数
1
解决办法
3677
查看次数

NestJs如何在特定时间每天运行 cron 作业 3 次

我正在构建一个通知触发方法,并希望每天在特定时间运行 3 次。

我已经检查了文档,但不理解正则表达式代码以及如何根据需要自定义它!

现在我的方法如下所示:(现在它在第 45 秒每分钟运行一次以进行测试)我需要它,例如每天下午 6 点、晚上 8 点、晚上 11 点运行

@Cron('45 * * * * *')
async sendNotificaiotns() {
    console.log('sending notification');

    try {
        const randomArticle = await this.articleRepository
            .createQueryBuilder()
            // .select("id")
            // .getMany();
            // .select("id")
            .orderBy("RAND()")
            .limit(1)
            .getOne();

        const input = new NotificationBySegmentBuilder()
            .setIncludedSegments(['Active Users', 'Inactive Users'])
            .notification() // .email()
            .setAttachments({
                data: {
                    ...randomArticle,
                },
                big_picture: encodeURI(randomArticle.image)
            })
            .setHeadings({ 'en': randomArticle.title })
            .setContents({'en': randomArticle.excerpt })
            .build();

        console.log(randomArticle);
        await this.oneSignalService.createNotification(input);

    } catch (e) {
        console.log(e);
    }
}
Run Code Online (Sandbox Code Playgroud)

javascript node.js cron-task typescript nestjs

3
推荐指数
2
解决办法
1万
查看次数

如何刷新角度分量

我正在使用ionic 4两种语言构建一个移动应用程序,ar并且en菜单抽屉是一个预构建的组件。

所以我需要刷新抽屉组件以获得基于 dom 方向的正确样式rtlltr

我现在所做的只是location.reload重新加载整个应用程序,但我认为这不是一个好的方法

javascript typescript angular

1
推荐指数
1
解决办法
1万
查看次数

Flutter 如何在特定屏幕上强制使用深色模式

我正在使用 flutter 构建一个新闻应用程序,该应用程序有 2 种主题模式,即深色和浅色,取决于手机设置,并且效果非常好,但我需要在应用程序上的某些屏幕上设置深色,例如视频部分或视频页面。 ..ETC

我用谷歌搜索了这个以及我已经做过的关于正常主题的所有结果。

我认为这里没有任何代码可以提供帮助,但如果有,请告诉我!

dart flutter flutter-layout

1
推荐指数
1
解决办法
1815
查看次数