[英]Firebase event listener never triggered (iOS app)
I'm trying to do something when a event is triggered in my app, using Firebase Functions: 当我使用Firebase函数在应用程序中触发事件时,我正在尝试做一些事情:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.sendIAPAnalytics = functions.analytics.event('IAP').onLog((event) => {
console.log("event done");
return true;
});
My event "IAP" is marked as conversion. 我的事件“ IAP”被标记为转换。 The event appears in Analytics DebugView.
该事件出现在Analytics DebugView中。
"IAP" event is called in my iOS app: 在我的iOS应用中调用了“ IAP”事件:
Analytics.logEvent("IAP", parameters: nil)
Function deployment is ok, without errors. 功能部署可以,没有错误。
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint /Users/cmilliet/Documents/APP TEST/functions
> eslint .
✔ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (39.34 KB) for uploading
✔ functions: functions folder uploaded successfully
i functions: updating Node.js 8 function sendIAPAnalytics(us-central1)...
✔ functions[sendIAPAnalytics(us-central1)]: Successful update operation.
✔ Deploy complete!
But nothing appears in Functions logs. 但是“功能”日志中什么也没有出现。
FYI, I have already implemented another function (onUpdate) without troubles. 仅供参考,我已经实现了另一个功能(onUpdate),没有任何麻烦。
What I missed? 我错过了什么?
Only conversion events from Analytics trigger Cloud Functions. 只有来自Google Analytics(分析)的转化事件才触发Cloud Functions。
Since IAP
seems to be a custom event, you need to mark it as a conversion event . 由于
IAP
似乎是自定义事件,因此您需要将其标记为转换事件 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.