chat-sdk / chat-sdk-firebase Goto Github PK
View Code? Open in Web Editor NEWFirebase scripts and rules
Firebase scripts and rules
Hello.
Precondition:
All Firebase setup steps are executed with no errors and firebase functions are listed on Functions page.
Problem:
pushListener function is not called when a new message is added to Realtime Database.
Observation:
running a function test using Google Cloud Platform testing UI produces an error:
TypeError: Cannot read property 'from' of null
the error is reported on this line:
const senderId = messageValue["from"];
Hi,
I have an existing project that already contains Firebase implementations ( pod 'Firebase/Analytics', pod 'Firebase/Crashlytics'), so when I implemented chatSDK, I removed old FirebaseApp.configure and I'we let ChatSDK do the config. And it is working fine, but only on my main project target. I have two more derived targets, both from main target, one for development (uses different google.services), and one exactly the same as my main target (uses the same google.services as main target). The problem is that FirebaseApp.configure ([FitApp config]) is never called. So the only thing I am changing is the target, the code is absolutely the same - except for dev target where set different config.firebaseGoogleServicesPlistName.
I have identified the root of the problem in BModuleHelper.m in currentServer method. Main target gets bServerFirebase for current server, and other targets drop to defaultServer option, and cause of that BFirebaseNetworkAdapter's init method never gets called.
My pod file:
# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '13.0'
target 'scoutone-ios' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for scoutone-ios
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Firebase/Messaging'
pod "ChatSDK", '~> 4.15.8'
pod "ChatSDKFirebase/Adapter", '~> 4.15.8'
pod "ChatSDKFirebase/FileStorage", '~> 4.15.8'
pod "ChatSDKFirebase/Push", '~> 4.15.8'
target 'scoutone-iosDEV' do
inherit! :search_paths
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Firebase/Messaging'
pod "ChatSDK", '~> 4.15.8'
pod "ChatSDKFirebase/Adapter", '~> 4.15.8'
pod "ChatSDKFirebase/FileStorage", '~> 4.15.8'
pod "ChatSDKFirebase/Push", '~> 4.15.8'
end
target 'scoutone-ios ChatDev' do
inherit! :search_paths
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Firebase/Messaging'
pod "ChatSDK", '~> 4.15.8'
pod "ChatSDKFirebase/Adapter", '~> 4.15.8'
pod "ChatSDKFirebase/FileStorage", '~> 4.15.8'
pod "ChatSDKFirebase/Push", '~> 4.15.8'
end
target 'scoutone-iosTests' do
inherit! :search_paths
# Pods for testing
end
end
EDIT:
This is a swift project
EDIT1:
I did some digging, and it seams that cocoapods don't insert
-framework "ChatSDKFirebase"
in OTHER_LDFLAGS of derived targets.
While integrating ChatSDK within Firebase, I noticed that the Firebase Functions for ChatSDK still uses Node v8 environment for Push Notifications Support.
You can check about it here: https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version
Tested this in Android and iOS.
steps to replicate
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.