How to use Firebase Push Notification Services without adding GoogleService-Info.plist file in Custom Created Framework Xcode - objective-c

I have created a custom iOS Framework and I want to use Firebase Cloud Messaging from Push Notifications such that If anyone integrates the Framework in his App then he must be able to receive Push Notifications with minimal configuration.
Also, can I add Push Notifications required code programmatically to avoid using GoogleService-Info.plist?
How can I achieve the above functionality?

I am trying to do something similar. The main issue here is giving your framework a bundle id and ensuring that it is kept when imported in the app. I have been suffering with firebase complaining about inconsistent bundle ids.
In order to initialise a firebase app programatically you can use the snippet below:
let manualOptions = FirebaseOptions.init(googleAppID: "", gcmSenderID: "")
manualOptions.bundleID = ""
manualOptions.apiKey = ""
manualOptions.projectID = ""
manualOptions.clientID = ""
FirebaseApp.configure(name: "gameballSDK_FirebaseApp", options: manualOptions)
All the data can be obtained from your firebase project GoogleService-Info.plist
This code initializes a secondary firebase app. I am not sure if someone has been able to receive push notifications using firebase secondary app. To initialize firebase primary app use the function below:
FirebaseApp.configure(options: <#T##FirebaseOptions#>)
This won't work if the app using your framework is already using firebase for push notifications

Related

How can I control push notification ON/OFF according to conditions? in React Native

I am making a push notification feature using reactnative push notification.
If I create a channel according to the reactnative push notification official statement, I can control it only when I enter the notification category in the application information of the application.
Can I use the reactnative push notifictaion library to control when I create a component within the app like Youtubemusic (below Image) and implement the push setting ON OFF control function? It doesn't seem to be in the official documentation.
I'm trying to implement this feature within the app, but I'm curious about how it's implemented in practice!
i'm not using local notification just remote
Basically, you have 2 way to achieve this: on backend side or on frontend side.
Backend
Send to backend current state of toggle settings inside your app. When backend want to send push to client, it is internally checks state of this toggle and make a decision send or not.
Frontend
All your push notifications must be send as data only and with high priority (contentAvailable: true, priority: 'high').
After that, only mobile app will control showing of push notifications, because data only push not display anything, just trigger mobile app about new message.
So, when your frontend app receive new push message, it check current user settings and make decision display it or not.

Get Google Click ID (gclid and msclkid) inside React Native

Inside the web today, we are getting gclid and msclkid when user get's on the lending page from the google ad, with
const { gclid, msclkid } = queryString.parse(location.search);
And we are storing it inside the DB,
Now we want to do the same inside our mobile app too, when user intall the app from the ad we want to get those 2 values and store them inside DB
We are using Expo EAS inside the mobile project righ now, but I'm not that experianced with this marketign tools
Anyone know how this can be done?
Thanks!
I've tried getting it inside the product thru firebase analytics but it seems it's not working or I'm doing it wrong, I also tried this lib https://www.npmjs.com/package/react-native-advertising-id but it's outdated and it does not seem to pull data I need

How to publish LocalScreenShare tracks from IOS to Web browser in React-Native using Twilio

I want to integrate Screen Share feature in my react-native application in which I am using Twilio for video communication. In Web we are able to achieve this by following these steps.
1 : We get the media device stream using
navigator.mediaDevices.getDisplayMedia({
video: true,
});
2 : Then we get the first stream tracks using
const newScreenTrack = first(stream.getVideoTracks());
3 : After that we set this newScreenTrack in some useState
const localScreenTrack = new TwilioVideo.LocalVideoTrack(
newScreenTrack
);
4 : After that we first unpublish the previous tracks and publish the new tracks using
videoRoom.localParticipant.publishTrack(newScreenTrack, {
name: "screen_share",
});
5 : And finally we pass these tracks in our ScreenShare component and render these tracks to View the screenShare from remote Participant.
I need to do the same thing in my react-native application as well. Where if localParticipant ask for screenShare permission to another participant. Participant will accept the permission and able to publish the localScreenShare tracks.
If anyone know this please help me in this. It would be really helpful. Thank you
I think this is an issue with the react-native-twilio-video-webrtc package. It seems that, as you discovered in this issue, that screen sharing was previously a feature of the library and it was removed as part of a refactor.
Sadly, the library does more work than the underlying Twilio libraries to look after the video and audio tracks. The Twilio library is built to be able to publish more than one track at a time, however this React Native library allows you to publish a single audio track and a single video track using the camera at a time.
In order to add screen sharing, you can either support pull requests like this one or refactor the library to separate getting access to the camera from publishing a video track, so that you can publish multiple video tracks at a time, including screen tracks.

selecting react native push notification

I am using react native and trying to add push notification.
My application need push notification because of chatting. I just need push notification to appear whenever the user receives chat message.
I've searched couple of libraries about push notification and found out firebase and react-native-push-notification.
Which one is proper library for this case and please tell me if there is other better way to solve this problem.
We're using invertase firebase notification library which is working so far better without any issues.
You'll get almost all the options which you needed for push notification customization like badges, etc.

codepush react native new package

I tried react native code push and it works flawlessly. Let's say I modify the text in my buttons to say something else, then with a single command, the update is sent to the users.
Now, lets say I am using a new npm library which requires some native code. Say react-native-image-picker (https://github.com/react-community/react-native-image-picker). Can code push handles this? I want the image picker functionality to be updated too in my users app. Thank you.
No - CodePush can only update JavaScript code and images.
CodePush does not update native code at all so any changes to native code require a full app build and deploy via the relevant app store or app distribution tool (e.g. HockeyApp).
Note: There are some limitations around images - full details here.