小编Lah*_*eti的帖子

单击通知后,必须将其重定向到IOS中的所需页面

在FCM通知中,当用户单击通知时,它将重定向到主页,但是我想重定向到除主页之外的特定页面,并且应用程序处于前台。将其重定向到特定页面后,应用程序应读取通知中的数据并在页面上显示数据。

这是代表上述想法的代码,但是它重定向到主页,没有任何反应(例如显示数据)。

我的APPDelegate.class

import UIKit
import Firebase
import UserNotifications 

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {  

    var window: UIWindow?
    let gcmMessageIDKey = "gcm.message_id"


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        FirebaseApp.configure()
        Messaging.messaging().delegate = self as! MessagingDelegate
        //Register for notification
        if #available(iOS 10.0, *) {
            // For iOS 10 display notification (sent via APNS)
            UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate

            let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
            UNUserNotificationCenter.current().requestAuthorization(
                options: authOptions,
                completionHandler: …
Run Code Online (Sandbox Code Playgroud)

ios swift firebase-cloud-messaging

6
推荐指数
2
解决办法
5767
查看次数

PassBookUiService意外退出

我用条纹实现苹果支付.我遵循条纹的官方文件.因此,每当我点击带苹果按钮的购买时,它都不会显示付款单.它显示的是一个错误

"passbookUiSevice意外退出".

并且远程警报视图服务的连接失败,

无法显示应用内付款界面:错误域= PKPassKitErrorDomain代码= -1"付款界面不可用"UserInfo = {NSLocalizedDescription =付款界面不可用.

当在Macbookair中在模拟器中运行相同的代码时,它工作得很好,但它在imac中不起作用.我不知道是什么问题.如何解决这个错误.

stripe-payments swift applepay

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

未捕获的TypeError:无法使用网站读取null的属性“ uid”

我想从Firestore获取注册用户的详细信息到html页面。当用户单击我的个人资料页面时,它将导航到下一个html页面,其中包含名字和姓氏等字段。在注册页面时已输入此字段。所以我想将这些详细信息从Firestore获取到下一个html页面。但是我收到了类似“无法读取null的属性'uid'的错误。如何解决这个问题,这是我的html页面:

<!doctype html>
<html lang="en">
    <head>
        <title> deyaPay</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
         <script src="https://www.gstatic.com/firebasejs/4.6.2/firebase-app.js"></script>
         <script src="https://www.gstatic.com/firebasejs/4.6.2/firebase-auth.js"></script>
        <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>
        <script src="https://www.gstatic.com/firebasejs/4.6.2/firebase-firestore.js"></script>
         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
         <script>
          var config = {
    apiKey: "AIzaSyAJsAstiMsrB2QGJyoqiTELw0vsWFVVahw",
    authDomain: "websignin-79fec.firebaseapp.com",
    databaseURL: "https://websignin-79fec.firebaseio.com",
    projectId: "websignin-79fec",
    storageBucket: "",
    messagingSenderId: "480214472501"
  };
   firebase.initializeApp(config);
   </script>
   <script src="https://www.gstatic.com/firebasejs/4.6.2/firebase-firestore.js"></script>
         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
   <style>
   // css goes here..
   </style> 
   <script type="text/javascript">
      function myProfile() {
          var user = firebase.auth().currentUser.uid;
          var db = firebase.firestore();
          var docRef …
Run Code Online (Sandbox Code Playgroud)

javascript firebase-authentication google-cloud-firestore

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

Firebase firestore:云功能未正确部署

我正在尝试使用云功能从云端防火墙获取文档数据.但是我收到了一个错误 Failed to configure trigger providers/cloud.firestore/eventTypes/document.write@firestore.googleapis.com (Split)

Error: Functions did not deploy properly.
Run Code Online (Sandbox Code Playgroud)

我尝试了很多选项,比如更新我的firebase工具,更改功能名称和部署但仍然遇到同样的错误.这是代码

const functions = require('firebase-functions');
        const Firestore = require('@google-cloud/firestore');
        const firestore = new Firestore();
        const admin = require('firebase-admin');
        admin.initializeApp(functions.config().firebase);
        const db = admin.firestore();
        exports.splitting = functions.firestore
            .document('deyaPayUsers/{authid}/Split/{authid}/SentInvitations/{autoid}')
            .onWrite(event =>{
            const ID = event.params.authid;
            const splitid = event.params.autoid;
            var document = event.data.data();
            //retrieve the data from the database and stored into document
            var ph1 = document.Invite1.PhoneNumber;
            console.log(document);
            console.log(ph1);
           });
Run Code Online (Sandbox Code Playgroud)

我的数据库路径是

/deyaPayUsers //collections
{authid}    //Document
/Split      //Collection
{authid}    //Document …
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-functions google-cloud-firestore

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

如何在 Android Java 中获取 Google 广告 ID

我正在尝试在 android java 中获取 google ad id (GAID),但我收到如下异常:

androidx.ads.identifier.AdvertisingIdNotAvailableException:没有可用的兼容 AndroidX 广告 ID 提供程序。

我的代码

ListenableFuture<AdvertisingIdInfo> adInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext());
    System.out.println("adinfo"+adInfo.toString());
    try {
      String id =   adInfo.get().getId();

      System.out.println("adod"+id);
    } catch (ExecutionException e) {
        e.printStackTrace();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
Run Code Online (Sandbox Code Playgroud)

我添加了依赖

  implementation 'com.google.android.gms:play-services-ads:19.4.0'
        implementation 'androidx.ads:ads-identifier:1.0.0-alpha04'
Run Code Online (Sandbox Code Playgroud)

在清单中我添加了

  <meta-data
                android:name="com.google.android.gms.ads.AD_MANAGER_APP"
                android:value="true"/>
Run Code Online (Sandbox Code Playgroud)

我尝试了很多解决方案,但没有用。请帮我解决这个问题。

java android

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