小编noo*_*gui的帖子

无法在 Google Slides API 上使用 PageSize 创建演示文稿

我正在尝试创建一个新的 4:3 演示文稿,而不是 16:9。

我阅读了这个参考并写了一些 ruby​​ 代码,但它没有用。新演示文稿的高度与我指定的不同。

方法:presentation.create | 幻灯片 API | 谷歌开发者

# foo.rb
require 'google/apis/slides_v1'
Slide = Google::Apis::SlidesV1 # alias
slides_service = Slide::SlidesService.new
# authorize...
new_presentation_object = Slide::Presentation.new(
  title: "test",
  page_size: Slide::Size.new(
    width:  Slide::Dimension.new(magnitude: 6_858_000, unit: 'EMU'),
    height: Slide::Dimension.new(magnitude: 9_141_000, unit: 'EMU')
  )
)
presentation = slide_service.create_presentation(new_presentation_object, fields: "pageSize,presentationId")
presentation.page_size
# => #<Google::Apis::SlidesV1::Size:0x007f99ef1fb630
#  @height=#<Google::Apis::SlidesV1::Dimension:0x007f99ef1f8278 @magnitude=5143500, @unit="EMU">,
#  @width=#<Google::Apis::SlidesV1::Dimension:0x007f99ef1fa550 @magnitude=9144000, @unit="EMU">>
Run Code Online (Sandbox Code Playgroud)

如何创建新的 4:3 演示文稿?
我发现没有 API 可以更改 PageSize 而是 CreatePresentation,但欢迎任何更改 PageSize 的想法。

google-slides-api

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

在移动浏览器上通过 angularfire 登录到谷歌时出现错误“403 disallowed_useragent”

我正在 angular4 中使用 angularfire2 v4.0.0-rc.2 开发一个项目并将其发布在 firebase 上。

使用 facebook 和 google 登录都可以在桌面浏览器和原生 android 应用程序上运行。

当我尝试通过移动浏览器在 chrome 中登录时,出现以下错误: 在此处输入图片说明

我发现了很多关于谷歌阻止 webViews 访问的帖子,但没有一个真正回答关于如何在没有不特定于 firebase 的解决方法的情况下解决问题的问题。

使用带有弹出窗口和重定向的 angularfire signIn 会发生错误。

有什么想法吗?

firebase firebase-authentication angularfire2 angular

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

将 FCM 与另一个数据库一起使用

我正在开发一个必须实现推送通知的移动应用程序。文档存储在SQL数据库中,人们离线下载后应该可以编辑这些文档,然后在手机再次上线后将修改保存在SQL数据库中。当应用程序关闭时,人们应该能够收到通知。

我听说我需要推送通知,对于 android 有 Firebase Cloud Messaging (FCM)。但是可以将 FCM 与我的 SQL 数据库一起使用吗?

文档中的所有教程仅讨论将应用程序与 Firebase 连接

android push-notification firebase firebase-cloud-messaging

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

离子3中的"运行时错误区已加载"

我正在使用离子3和Firebase版本4.13.1上的Firebase身份验证开发我的项目.我安装了Angularfire2.我创建了一个注册表单,并在使用ionic-lab测试我的应用程序时成功将用户详细信息放入firebase数据库.但是当我关闭并重新打开我的项目时出现问题,我收到以下错误:

ERROR in ... node_modules/angularfire2/firebase.app.module.d.ts(10,22):类'FirebaseApp'错误地实现了类'FirebaseApp'.你的意思是扩展'FirebaseApp'并继承其成员作为子类吗?"FirebaseApp"类型中缺少属性"automaticDataCollectionEnabled".

我加入这行解决了上述错误automaticDataCollectionEnabled: boolean;到这个类export declare class FirebaseApp implements _FirebaseApp { }

现在我无法运行我的应用程序,因为它现在给我一个新的错误:

运行时错误区已加载.

Error: Zone already loaded.
    at http://localhost:8100/build/vendor.js:117594:15
    at http://localhost:8100/build/vendor.js:118206:3
    at FUNCTION (http://localhost:8100/build/vendor.js:117571:10)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:117574:2)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:120624:30)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at Object.defineProperty.value (http://localhost:8100/build/vendor.js:69092:66)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:117089:72)
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30)
Run Code Online (Sandbox Code Playgroud)

我以为我可能正在加载模块两次所以我试图<script src="build/vendor.js"></script>从index.html 删除: 得到一个新的运行时错误: 没有定义webpack Jsonp.所以我把脚本放回去了.

我现在被困住了,非常感谢任何帮助.

firebase ionic-framework firebase-authentication angular

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

动态切换到不同的 Firebase 项目数据库 (Javascript)

我需要开发一个聚合管理 web 应用程序,它需要连接到不同的 firebase 项目数据库(不同的 google 帐户)。是否可以通过 javascript 动态切换到不同的 firebase 项目数据库?

javascript firebase firebase-realtime-database

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

FirebaseInitProvider。未找到资源

我已经在应用程序中使用 Google Firebase 一段时间了,我正在做一些维护和一些更新,但我不断收到:

无法获取提供程序 com.google.firebase.provider.FirebaseInitProvider

每当我启动应用程序时都会发生这种情况。自从我开始使用 FCM 以来,我已经尝试过启用MultiDex和我的applicationId设置。我只是不知道它可能是什么。

任何帮助都感激不尽。

build.gradle(应用程序):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
    applicationId "com.vivatrucking.drivershub"
    multiDexEnabled true
    minSdkVersion 15
    targetSdkVersion 27
    versionCode 2
    versionName "1.0.1"
    testInstrumentationRunner  "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    // android
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.volley:volley:1.0.0'
    // google …
Run Code Online (Sandbox Code Playgroud)

java firebase android-studio android-gradle-plugin firebase-cloud-messaging

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

在Beta 0.3.2上使用Firebase-auth插件的Flutter的Xcode构建错误:不兼容的块指针

这涉及firebase-auth插件flutter.我在两台mac计算机上运行相同的代码.我刚刚对后者进行了全新安装,并在上面遇到了一个构建错误FirebaseAuthPlugin.m:不兼容的块指针

/Users/sergebesnard/Development/flutter/.pub-cache/hosted/pub.dartlang.org/
firebase_auth-0.5.9/ios/Classes/FirebaseAuthPlugin.m:69:53:
Incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'FIRAuthDataResultCallback _Nullable' (aka 'void (^)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)')
Run Code Online (Sandbox Code Playgroud)

在我的笔记本电脑上,代码构建顺利,唯一的区别是测试版,这0.3.1是安装Android工具链.

在iMac上(失败):

flutter doctor -v
[?] Flutter (Channel beta, v0.3.2, on Mac OS X 10.13.4 17E202, locale fr-BE)
    • Flutter version 0.3.2 at /Users/sergebesnard/Development/flutter
    • Framework revision 44b7e7d3f4 (3 weeks ago), 2018-04-20 01:02:44 -0700
    • Engine revision 09d05a3891
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[?] …
Run Code Online (Sandbox Code Playgroud)

firebase firebase-authentication flutter flutter-dependencies

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

Firebase Auth SMS 验证码用于创建电话身份验证

我使用firebase构建react native,并使用插件react-native-firebase。我实现了 firebase auth 电话,当我将短信代码发送到我的手机时,我得到了 2 个错误:

  1. 当我输入正确的短信代码时出现错误

用于创建手机认证凭证的短信验证码无效。请重新发送验证码短信

  1. 当我重新加载应用程序然后想再次输入代码时,我收到错误

短信代码已过期。请重新发送验证码重试

我该如何解决这些问题?另外,有内置发送重发短信吗?

那是我的代码

confirmPhone = async (phoneNumber) => {
    return new Promise((res, rej) => {
        firebase.auth().verifyPhoneNumber(phoneNumber)
            .on('state_changed', async (phoneAuthSnapshot) => {
                switch (phoneAuthSnapshot.state) {
                case firebase.auth.PhoneAuthState.AUTO_VERIFIED:
                    await this.confirmCode(phoneAuthSnapshot.verificationId, phoneAuthSnapshot.code, phoneAuthSnapshot)
                    res(phoneAuthSnapshot)

                    break

                case firebase.auth.PhoneAuthState.CODE_SENT:
                    // await userSettings.set(AUTH_KEYS.VERIFICATION_ID, phoneAuthSnapshot.verificationId)
                    UserStore.setVerificationId(phoneAuthSnapshot.verificationId)
                    res(phoneAuthSnapshot)
                    break

                case firebase.auth.PhoneAuthState.AUTO_VERIFY_TIMEOUT: // or 'timeout'
                    UserStore.setVerificationId(phoneAuthSnapshot.verificationId)
                    res(phoneAuthSnapshot)


                case firebase.auth.PhoneAuthState.ERROR:
                    UserStore.setErrorConfirmationCode(phoneAuthSnapshot.error)
                    rej(phoneAuthSnapshot)
                    break

                }
            })
    })
}

confirmCode = async (verificationId, code, phoneAuthSnapshot) => {
    UserStore.setCodeInput(code)
    try{
        const credential = …
Run Code Online (Sandbox Code Playgroud)

firebase firebase-authentication

5
推荐指数
0
解决办法
1903
查看次数

如何在Angular(6)和Firebase Firestore设置中分页回到上一页

在将Angular与Cloud Firestore(Firebase)结合使用时,似乎有很多示例,教程和视频,以及如何分页到下一页。

但是经过大量搜索后,我找不到找到前一页的方法。我得到的最远的就是返回第一页。

这是我的服务现在的外观:

import { Injectable } from '@angular/core';
import { AngularFirestore } from 'angularfire2/firestore';
import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Task } from './task.model';

@Injectable()
export class TaskService {
  private _data: BehaviorSubject<Task[]>;
  public data: Observable<Task[]>;
  firstEntry: any;
  latestEntry: any;

  constructor(private afs: AngularFirestore) { }

  public first() {
    this._data = new BehaviorSubject([]);
    this.data = this._data.asObservable();

    const tasksRef = this.getCollection('tasks', ref => ref.orderBy('createdAt').limit(5))
      .subscribe(data => {
        this.firstEntry = data[0].doc;
        this.latestEntry = …
Run Code Online (Sandbox Code Playgroud)

pagination firebase firebase-realtime-database angular google-cloud-firestore

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

将PWA安装到主屏幕后,我的通知徽章图标未显示

我有一个移动网站,可以接收推送通知.firebase-messaging-sw.js上的一些代码如下,

 messaging.setBackgroundMessageHandler(function(payload) {
  console.log('[firebase-messaging-sw.js] Received background message ', payload);
  // Customize notification here
  var notificationTitle = payload.data.title;
  var notificationOptions = {
    body: payload.data.body,
    icon: payload.data.icon,
    data: payload.data.click_action,
    badge: "{icon url}",
    image: payload.data.image,
    tag: payload.data.unique_id
  };


  return self.registration.showNotification(notificationTitle,
    notificationOptions);
});
Run Code Online (Sandbox Code Playgroud)

当我在移动Chrome上允许通知时,通知会完美显示,我的自定义徽章徽标显示在通知栏上.但在我点击"添加到主屏幕"后,通知徽章图标将成为默认的钟形图标.为什么会这样,是否有任何改变方法?

谢谢.

push-notification firebase service-worker progressive-web-apps firebase-cloud-messaging

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