By continuing you indicate that you have read and agree to our Terms of service and Privacy policy
By continuing you indicate that you have read and agree to our Terms of service and Privacy policy
Popular Releases
Popular Libraries
New Libraries
Top Authors
Trending Kits
Trending Discussions
Learning
Explore Related Topics
dubbo | dubbo-3.0.7 |
taro | chore(release): publish 3.4.7 |
EventBus | EventBus 3.3.1 |
celery | 5.2.6 |
python-telegram-bot | v13.11 |
dubbo dubbo-3.0.7 |
taro chore(release): publish 3.4.7 |
EventBus EventBus 3.3.1 |
celery 5.2.6 |
python-telegram-bot v13.11 |
by apache java
37142 Apache-2.0
Apache Dubbo is a high-performance, java based, open source RPC framework.
by dcloudio javascript
36431 Apache-2.0
uni-app 是使用 Vue 语法开发小程序、H5、App的统一框架
by NervJS typescript
30875 MIT
开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
by greenrobot java
23725 Apache-2.0
Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
by littlecodersh python
21699 NOASSERTION
A complete and graceful API for Wechat. 微信个人号接口、微信机器人及命令行微信,三十行即可自定义个人号机器人。
by apache java
21667 Apache-2.0
Mirror of Apache Kafka
by celery python
19164 NOASSERTION
Distributed Task Queue (development branch)
by python-telegram-bot python
18256 NOASSERTION
We have made you a wrapper you can't refuse
by PHPMailer php
18018 LGPL-2.1
The classic email sending library for PHP
by apache java
37142 Apache-2.0
Apache Dubbo is a high-performance, java based, open source RPC framework.
by dcloudio javascript
36431 Apache-2.0
uni-app 是使用 Vue 语法开发小程序、H5、App的统一框架
by NervJS typescript
30875 MIT
开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
by greenrobot java
23725 Apache-2.0
Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
by littlecodersh python
21699 NOASSERTION
A complete and graceful API for Wechat. 微信个人号接口、微信机器人及命令行微信,三十行即可自定义个人号机器人。
by apache java
21667 Apache-2.0
Mirror of Apache Kafka
by celery python
19164 NOASSERTION
Distributed Task Queue (development branch)
by python-telegram-bot python
18256 NOASSERTION
We have made you a wrapper you can't refuse
by PHPMailer php
18018 LGPL-2.1
The classic email sending library for PHP
by alexeygrigorev html
5065 CC-BY-4.0
Data science interview questions and answers
by orkestral javascript
3775 Apache-2.0
Venom is the most complete javascript library for Whatsapp, 100% Open Source.
by fosscord javascript
3576 AGPL-3.0
Fosscord is a free open source selfhostable discord compatible communication platform
by didi java
3451 Apache-2.0
一站式Apache Kafka集群指标监控与运维管控平台
by vectorizedio c++
3320
Redpanda is the real-time engine for modern apps. Kafka API Compatible; 10x faster 🚀 See more at redpanda.com
by ottomated typescript
3159 GPL-3.0
Free, open, Among Us Proximity Chat
by sdushantha shell
2789 MIT
A temporary email right from your terminal written in POSIX sh
by didi java
2639 Apache-2.0
一站式Apache Kafka集群指标监控与运维管控平台
by raycast shell
2351 MIT
Script Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.
by alexeygrigorev html
5065 CC-BY-4.0
Data science interview questions and answers
by orkestral javascript
3775 Apache-2.0
Venom is the most complete javascript library for Whatsapp, 100% Open Source.
by fosscord javascript
3576 AGPL-3.0
Fosscord is a free open source selfhostable discord compatible communication platform
by didi java
3451 Apache-2.0
一站式Apache Kafka集群指标监控与运维管控平台
by vectorizedio c++
3320
Redpanda is the real-time engine for modern apps. Kafka API Compatible; 10x faster 🚀 See more at redpanda.com
by ottomated typescript
3159 GPL-3.0
Free, open, Among Us Proximity Chat
by sdushantha shell
2789 MIT
A temporary email right from your terminal written in POSIX sh
by didi java
2639 Apache-2.0
一站式Apache Kafka集群指标监控与运维管控平台
by raycast shell
2351 MIT
Script Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.
1
86 Libraries
1233
2
65 Libraries
121059
3
40 Libraries
494
4
34 Libraries
2254
5
32 Libraries
3521
6
27 Libraries
2625
7
27 Libraries
16029
8
26 Libraries
1012
9
26 Libraries
2587
10
26 Libraries
14368
Use these Python Machine Learning libraries for developing supervised and unsupervised learning algorithms, data pre-processing and feature extraction tools, deep learning frameworks and more. Following are the top use cases of these shortlisted libraries for Python Machine Learning, · Pre-processing of data that includes data cleaning and feature engineering tasks such as normalization, imputation, missing value treatment, and outlier detection. · Model selecting and optimizing, such as cross-validation, hyperparameter tuning, and model selection metrics. · Visualizations to understand data and results. This includes visualizing data distributions, feature importance, and model performance. · Developing algorithms, including supervised learning algorithms (e.g. linear regression, logistic regression, support vector machines, decision trees, random forests, and neural networks) as well as unsupervised learning algorithms (e.g. clustering, dimensionality reduction, and anomaly detection). · Calculating performance metrics such as accuracy, precision, recall, and F1 score. The following is a list of the 18 most popular open-source Python libraries for Machine Learning,
Today data has generated constantly, and business needs the latest data to be used for business decisions via intelligent applications. This requires constantly processing data in a streaming fashion to get the lower latency. This will also allow optimum usage of the resources and get the up-to-date data loaded into the systems. Streaming Using the below libraries, you can build you own correct concurrent and scalable streaming applications. Stream processing engine The below open-source stream processing framework provide you with stream processing capabilities. Data Pipeline Below libraries help in defining both batch and parallel processing pipelines running in a distributed processing backends.
Stream processing involves multiple processing steps in near real-time as the data is produced, transported, and received at the target location. Some examples of such processing requirements processing data in motion are from continuous streams from sensors in IT infrastructure, machine sensors, health sensors, stock trade activities, etc
To create an end-to-end stream processing, you will need components performing different tasks stitched together in a pipeline and workflow.
Mailchimp recently agreed to be acquired by Intuit for $12 billion. The company founded by Ben Chestnut and Dan Kurzius in 2001 hit possibly the highest sale amount ever of a privately bootstrapped company, and is an inspiration to all startups on building a company ground up.
I found three interesting strategic decisions in Mailchimp’s journey. Mailchimp was one of the earliest providers to introduce micropayments of $5 a month in their early days. Freemium and micropayments have become a template for SaaS today. Secondly, they focused on small businesses, when most tech was geared towards the enterprise. Lastly, they pivoted the company away from just email into social media and marketing. Kudos to Ben and Dan on this fantastic journey.
The $12 Billion valuation does indicate a massive potential in Email marketing! Did you know there are over 100,000 libraries in open source for email automation and marketing? You could look to build the next unicorn in email automation! kandi kit for Email Marketing Solutions showcases open source libraries across Email Marketing Automation, Core Email Platforms, Gathering and Processing Email Addresses, and engaging Email Templates. Email Marketing Automation Open source and public reusable libraries that automate most parts of Email marketing. Gathering and Processing Email Addresses Open source and public reusable libraries that gather and process Email addresses. Email Platform Libraries Platforms that implement core Email functions if you are looking to implement a bespoke solution. Email Templates Open source and public reusable libraries that provide Email templates to achieve meaningful engagement with customers.
Since the release of Siri in 2011, voice assistants have become a new trend in mobile apps. Most of people think that creating a voice assistant like Siri and Alexa is very complicated, but it is not. So today we will see some of the best Python AI Assistant libraries. An Assistant library is a collection of routines that allow the user to build software. It is an application programming interface (API), which provides building blocks for developing software applications for a specific purpose or multiple purposes. Assistant libraries are not standalone programs. Instead, they are called from programs written in Python or other languages.
Build your own Virtual AI assistant with NLP, speech analysis, command retrieval, and more. In this kit, we recommend you some of the best python AI assistant libraries available in 2022 including Mycroft Core - the Mycroft Artificial Intelligence platform; Jarvis - Personal Assistant for Linux and macOS; Kalliope - framework that will help you to create your own personal assistant.
Python has built-in support for sending emails using SMTP protocol. The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon. Python can be used to send an email in a variety of ways: as plain text, with an attached file, or as an HTML/Markdown-formatted email message.
There are also several third-party libraries available in the market like: EmailMessage module in Python’s standard library, EmailReplyParser - parse responses from email threads, Flanker - a parsing and validation library written in Python by Mailgun, Mailgun-py - an official and actively maintained Mailgun library for Python. Check 15 best Python Email libraries in 2022 for developers:
An email has become an inevitable method of personal and business communications. Implementing Email API to applications make it fast, cheap, and accessible. Email helps firms as it provides efficient and effective ways to transmit all kinds of electronic data. Small, medium & large-scale businesses use web applications that require constant user inputs and outputs in product launch, manufacturing, customer outreach, and maintenance. Email plays a critical role in providing these inputs and outputs. Email API libraries are available to integrate and make this feature adapt to your web application. You can customize, integrate and implement Email API using reusable libraries.
Automated Email Sender is a powerful tool that is used in new generation marketing technology. Email Automation lets us send the right email to the right people at right time. Automate email sender provides flexibility, reduces the complexity, and saves the precious time of the sender. Email Automation is also been a strong platform and gives strong communication between sender and receiver. Use the following best-in class libraries to create your own automated email sender.
This is spring boot library which is used to service registry
Machine Learning is a type of artificial intelligence that helps in predicting more accurate outcomes without the need for complex or long programming.
Machine learning is classified into different types: supervised, unsupervised, semi-supervised, and reinforcement learning.
1) Supervised learning uses binary classification, multi-class classification, and regression to train and model data.
2) Unsupervised used clustering, and KNN to train and model data.
Data Analysis and Modelling in ML
Data analysis is a process of cleaning, changing, and modifying data that are relevant for modeling and visualization. Quality data is helpful for efficient modeling and better prediction.
Natural Language Processing
NLP helps computers to communicate with humans in their own language and performs functions with that communication.
Chatbot
These libraries help train chats in text and voice. It uses python and natural language understanding.
Use these Python Machine Learning libraries for developing supervised and unsupervised learning algorithms, data pre-processing and feature extraction tools, deep learning frameworks and more. Following are the top use cases of these shortlisted libraries for Python Machine Learning, · Pre-processing of data that includes data cleaning and feature engineering tasks such as normalization, imputation, missing value treatment, and outlier detection. · Model selecting and optimizing, such as cross-validation, hyperparameter tuning, and model selection metrics. · Visualizations to understand data and results. This includes visualizing data distributions, feature importance, and model performance. · Developing algorithms, including supervised learning algorithms (e.g. linear regression, logistic regression, support vector machines, decision trees, random forests, and neural networks) as well as unsupervised learning algorithms (e.g. clustering, dimensionality reduction, and anomaly detection). · Calculating performance metrics such as accuracy, precision, recall, and F1 score. The following is a list of the 18 most popular open-source Python libraries for Machine Learning,
Today data has generated constantly, and business needs the latest data to be used for business decisions via intelligent applications. This requires constantly processing data in a streaming fashion to get the lower latency. This will also allow optimum usage of the resources and get the up-to-date data loaded into the systems. Streaming Using the below libraries, you can build you own correct concurrent and scalable streaming applications. Stream processing engine The below open-source stream processing framework provide you with stream processing capabilities. Data Pipeline Below libraries help in defining both batch and parallel processing pipelines running in a distributed processing backends.
Stream processing involves multiple processing steps in near real-time as the data is produced, transported, and received at the target location. Some examples of such processing requirements processing data in motion are from continuous streams from sensors in IT infrastructure, machine sensors, health sensors, stock trade activities, etc
To create an end-to-end stream processing, you will need components performing different tasks stitched together in a pipeline and workflow.
Mailchimp recently agreed to be acquired by Intuit for $12 billion. The company founded by Ben Chestnut and Dan Kurzius in 2001 hit possibly the highest sale amount ever of a privately bootstrapped company, and is an inspiration to all startups on building a company ground up.
I found three interesting strategic decisions in Mailchimp’s journey. Mailchimp was one of the earliest providers to introduce micropayments of $5 a month in their early days. Freemium and micropayments have become a template for SaaS today. Secondly, they focused on small businesses, when most tech was geared towards the enterprise. Lastly, they pivoted the company away from just email into social media and marketing. Kudos to Ben and Dan on this fantastic journey.
The $12 Billion valuation does indicate a massive potential in Email marketing! Did you know there are over 100,000 libraries in open source for email automation and marketing? You could look to build the next unicorn in email automation! kandi kit for Email Marketing Solutions showcases open source libraries across Email Marketing Automation, Core Email Platforms, Gathering and Processing Email Addresses, and engaging Email Templates. Email Marketing Automation Open source and public reusable libraries that automate most parts of Email marketing. Gathering and Processing Email Addresses Open source and public reusable libraries that gather and process Email addresses. Email Platform Libraries Platforms that implement core Email functions if you are looking to implement a bespoke solution. Email Templates Open source and public reusable libraries that provide Email templates to achieve meaningful engagement with customers.
Since the release of Siri in 2011, voice assistants have become a new trend in mobile apps. Most of people think that creating a voice assistant like Siri and Alexa is very complicated, but it is not. So today we will see some of the best Python AI Assistant libraries. An Assistant library is a collection of routines that allow the user to build software. It is an application programming interface (API), which provides building blocks for developing software applications for a specific purpose or multiple purposes. Assistant libraries are not standalone programs. Instead, they are called from programs written in Python or other languages.
Build your own Virtual AI assistant with NLP, speech analysis, command retrieval, and more. In this kit, we recommend you some of the best python AI assistant libraries available in 2022 including Mycroft Core - the Mycroft Artificial Intelligence platform; Jarvis - Personal Assistant for Linux and macOS; Kalliope - framework that will help you to create your own personal assistant.
Python has built-in support for sending emails using SMTP protocol. The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon. Python can be used to send an email in a variety of ways: as plain text, with an attached file, or as an HTML/Markdown-formatted email message.
There are also several third-party libraries available in the market like: EmailMessage module in Python’s standard library, EmailReplyParser - parse responses from email threads, Flanker - a parsing and validation library written in Python by Mailgun, Mailgun-py - an official and actively maintained Mailgun library for Python. Check 15 best Python Email libraries in 2022 for developers:
An email has become an inevitable method of personal and business communications. Implementing Email API to applications make it fast, cheap, and accessible. Email helps firms as it provides efficient and effective ways to transmit all kinds of electronic data. Small, medium & large-scale businesses use web applications that require constant user inputs and outputs in product launch, manufacturing, customer outreach, and maintenance. Email plays a critical role in providing these inputs and outputs. Email API libraries are available to integrate and make this feature adapt to your web application. You can customize, integrate and implement Email API using reusable libraries.
Automated Email Sender is a powerful tool that is used in new generation marketing technology. Email Automation lets us send the right email to the right people at right time. Automate email sender provides flexibility, reduces the complexity, and saves the precious time of the sender. Email Automation is also been a strong platform and gives strong communication between sender and receiver. Use the following best-in class libraries to create your own automated email sender.
This is spring boot library which is used to service registry
Machine Learning is a type of artificial intelligence that helps in predicting more accurate outcomes without the need for complex or long programming.
Machine learning is classified into different types: supervised, unsupervised, semi-supervised, and reinforcement learning.
1) Supervised learning uses binary classification, multi-class classification, and regression to train and model data.
2) Unsupervised used clustering, and KNN to train and model data.
Data Analysis and Modelling in ML
Data analysis is a process of cleaning, changing, and modifying data that are relevant for modeling and visualization. Quality data is helpful for efficient modeling and better prediction.
Natural Language Processing
NLP helps computers to communicate with humans in their own language and performs functions with that communication.
Chatbot
These libraries help train chats in text and voice. It uses python and natural language understanding.
QUESTION
Error APNS device token not set before retrieving FCM Token for Sender ID
Asked 2022-Mar-01 at 17:08I am receiving messages from firebase for notifications with APNs. In firebase, I have the certificate of APNs key, with the same id in the Xcode project in Firebase that is extracted from Apple Developer.
But I don't know why this could be happening and I get this error and it is registering two tokens in the Messaging extension:
1extension AppDelegate : MessagingDelegate {
2 func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {}}
3
APNS device token not set before retrieving FCM Token for Sender ID '########'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set.
Added what I have in the AppDelegate
1extension AppDelegate : MessagingDelegate {
2 func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {}}
3import Firebase
4import MasivPushIosSdk
5
6@UIApplicationMain
7class AppDelegate: UIResponder, UIApplicationDelegate{
8
9 var firebaseToken: String = ""
10
11 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
12
13 FirebaseApp.configure()
14 self.registerForFirebaseNotification(application: application)
15 Messaging.messaging().delegate = self
16 return true
17 }
18
19 func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
20 Messaging.messaging().apnsToken = deviceToken
21 }
22
23 func registerForFirebaseNotification(application: UIApplication) {
24 if #available(iOS 10.0, *) {
25 // For iOS 10 display notification (sent via APNS)
26 UNUserNotificationCenter.current().delegate = self
27
28 let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
29 UNUserNotificationCenter.current().requestAuthorization(
30 options: authOptions,
31 completionHandler: {_, _ in })
32 } else {
33 let settings: UIUserNotificationSettings =
34 UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
35 application.registerUserNotificationSettings(settings)
36 }
37
38 application.registerForRemoteNotifications()
39 }
40
41}
42
43extension AppDelegate: MessagingDelegate, UNUserNotificationCenterDelegate {
44
45//MessagingDelegate
46 func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
47 self.firebaseToken = fcmToken!
48 print("Firebase token: \(fcmToken)")
49 }
50
51 //UNUserNotificationCenterDelegate
52 func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
53 print("APNs received with: \(userInfo)")
54 }
55}
56
ANSWER
Answered 2021-Oct-26 at 05:58This is a simulator only log. You can safely ignore it. The reason you get this is that Firebase tries to create a mapping from the FCM token to the APNS token so it can send the APNS messages to the iOS devices. However, there is no APNS token on the simulator so the mapping fails.
Try testing it on an actual device to see if you still get the error.
QUESTION
java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest;
Asked 2022-Feb-25 at 23:22It was working fine before I have done nothing, no packages update, no gradle update no nothing just created new build and this error occurs. but for some team members the error occur after gradle sync.
The issue is that build is generating successfully without any error but when opens the app it suddenly gets crash (in both debug and release mode)
Error
1 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2 java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3 at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4 at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5 at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8 at java.lang.Thread.run(Thread.java:923)
9
gradle-wrapper.properties
1 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2 java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3 at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4 at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5 at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8 at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14
build.gradle
1 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2 java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3 at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4 at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5 at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8 at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17 ext {
18 buildToolsVersion = "30.0.2"
19 minSdkVersion = 21
20 compileSdkVersion = 30
21 targetSdkVersion = 30
22 ndkVersion = "21.4.7075529"
23 }
24 repositories {
25 google()
26 mavenCentral()
27 jcenter()
28 // maven {
29 // url 'https://maven.fabric.io/public'
30 // }
31 maven { url "https://www.jitpack.io" }
32 }
33 dependencies {
34 classpath("com.android.tools.build:gradle:4.2.2")
35 classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
36 // Add the Fabric Crashlytics plugin.
37 // classpath 'io.fabric.tools:gradle:1.31.2'
38 // firebase performance sdk
39 classpath 'com.google.firebase:perf-plugin:1.4.0'
40 classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43 // NOTE: Do not place your application dependencies here; they belong
44 // in the individual module build.gradle files
45 }
46}
47
48allprojects {
49 repositories {
50 mavenCentral()
51 mavenLocal()
52 maven {
53 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54 url("$rootDir/../node_modules/react-native/android")
55 }
56 maven {
57 // Android JSC is installed from npm
58 url("$rootDir/../node_modules/jsc-android/dist")
59 }
60
61 google()
62 jcenter()
63 maven { url 'https://www.jitpack.io' }
64 }
65}
66
67
68subprojects {
69 afterEvaluate {project ->
70 if (project.hasProperty("android")) {
71 android {
72 buildToolsVersion "28.0.3"
73 compileSdkVersion 28
74 }
75 }
76 }
77}
78
79subprojects {
80 afterEvaluate {project ->
81 if (project.hasProperty("android")) {
82 android {
83 compileSdkVersion 29
84 buildToolsVersion '29.0.3'
85 }
86 }
87 }
88}
89
packages
1 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2 java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3 at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4 at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5 at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8 at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17 ext {
18 buildToolsVersion = "30.0.2"
19 minSdkVersion = 21
20 compileSdkVersion = 30
21 targetSdkVersion = 30
22 ndkVersion = "21.4.7075529"
23 }
24 repositories {
25 google()
26 mavenCentral()
27 jcenter()
28 // maven {
29 // url 'https://maven.fabric.io/public'
30 // }
31 maven { url "https://www.jitpack.io" }
32 }
33 dependencies {
34 classpath("com.android.tools.build:gradle:4.2.2")
35 classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
36 // Add the Fabric Crashlytics plugin.
37 // classpath 'io.fabric.tools:gradle:1.31.2'
38 // firebase performance sdk
39 classpath 'com.google.firebase:perf-plugin:1.4.0'
40 classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43 // NOTE: Do not place your application dependencies here; they belong
44 // in the individual module build.gradle files
45 }
46}
47
48allprojects {
49 repositories {
50 mavenCentral()
51 mavenLocal()
52 maven {
53 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54 url("$rootDir/../node_modules/react-native/android")
55 }
56 maven {
57 // Android JSC is installed from npm
58 url("$rootDir/../node_modules/jsc-android/dist")
59 }
60
61 google()
62 jcenter()
63 maven { url 'https://www.jitpack.io' }
64 }
65}
66
67
68subprojects {
69 afterEvaluate {project ->
70 if (project.hasProperty("android")) {
71 android {
72 buildToolsVersion "28.0.3"
73 compileSdkVersion 28
74 }
75 }
76 }
77}
78
79subprojects {
80 afterEvaluate {project ->
81 if (project.hasProperty("android")) {
82 android {
83 compileSdkVersion 29
84 buildToolsVersion '29.0.3'
85 }
86 }
87 }
88}
89"dependencies": {
90 "@eva-design/eva": "^2.1.0",
91 "@react-native-async-storage/async-storage": "^1.15.14",
92 "@react-native-community/blur": "^3.6.0",
93 "@react-native-community/checkbox": "^0.5.0",
94 "@react-native-community/netinfo": "^6.0.1",
95 "@react-native-community/toolbar-android": "^0.1.0-rc.2",
96 "@react-native-firebase/analytics": "^10.3.1",
97 "@react-native-firebase/app": "^10.3.0",
98 "@react-native-firebase/auth": "^10.3.1",
99 "@react-native-firebase/crashlytics": "^10.3.1",
100 "@react-native-firebase/dynamic-links": "^10.3.1",
101 "@react-native-firebase/firestore": "^10.3.1",
102 "@react-native-firebase/iid": "^10.3.1",
103 "@react-native-firebase/in-app-messaging": "^10.3.1",
104 "@react-native-firebase/messaging": "^10.3.1",
105 "@react-native-firebase/perf": "^10.3.1",
106 "@react-native-firebase/remote-config": "^10.3.1",
107 "@react-native-firebase/storage": "^10.3.1",
108 "@react-native-picker/picker": "^2.1.0",
109 "@react-navigation/bottom-tabs": "^6.0.9",
110 "@react-navigation/native": "^6.0.6",
111 "@react-navigation/stack": "^6.0.11",
112 "@types/react-native": "^0.65.5",
113 "@ui-kitten/components": "^5.1.0",
114 "axios": "^0.19.0",
115 "i18n-js": "^3.5.1",
116 "moment": "^2.24.0",
117 "native-base": "2.13.8",
118 "react": "17.0.2",
119 "react-content-loader": "^4.3.4",
120 "react-native": "0.66.0",
121 "react-native-actions-sheet": "^0.5.6",
122 "react-native-adjust": "^4.28.0",
123 "react-native-amplitude-analytics": "^0.2.7",
124 "react-native-animatable": "^1.3.3",
125 "react-native-code-push": "^7.0.4",
126 "react-native-config": "^1.3.3",
127 "react-native-contacts": "^5.0.7",
128 "react-native-dots-pagination": "^0.2.0",
129 "react-native-fbsdk-next": "^6.2.0",
130 "react-native-fingerprint-scanner": "^6.0.0",
131 "react-native-floating-action": "^1.22.0",
132 "react-native-geocoding": "^0.4.0",
133 "react-native-geolocation-service": "^5.2.0",
134 "react-native-gesture-handler": "^1.5.2",
135 "react-native-get-random-values": "^1.4.0",
136 "react-native-html-to-pdf-lite": "^0.11.0",
137 "react-native-image-base64": "^0.1.4",
138 "react-native-image-pan-zoom": "^2.1.11",
139 "react-native-image-picker": "^4.1.2",
140 "react-native-image-resizer": "^1.2.0",
141 "react-native-in-app-review": "^2.1.7",
142 "react-native-linear-gradient": "^2.5.6",
143 "react-native-loading-spinner-overlay": "^1.1.0",
144 "react-native-material-menu": "^1.0.0",
145 "react-native-material-textfield": "^0.16.1",
146 "react-native-modal": "^13.0.0",
147 "react-native-phone-call": "^1.0.9",
148 "react-native-ratings": "^7.3.0",
149 "react-native-reanimated": "^1.13.0",
150 "react-native-safe-area-context": "^3.3.2",
151 "react-native-screens": "^3.9.0",
152 "react-native-share": "^7.2.1",
153 "react-native-smooth-pincode-input": "^1.0.9",
154 "react-native-sms-retriever": "https://github.com/sarmad1995/react-native-sms-retriever.git",
155 "react-native-snap-carousel": "^3.9.1",
156 "react-native-splash-screen": "^3.2.0",
157 "react-native-svg": "^12.1.1",
158 "react-native-version-check": "^3.4.2",
159 "react-native-version-number": "^0.3.6",
160 "react-native-view-shot": "^3.1.2",
161 "react-native-walkthrough-tooltip": "^1.3.0",
162 "react-redux": "^7.1.3",
163 "redux": "^4.0.4",
164 "redux-logger": "^3.0.6",
165 "redux-persist": "^6.0.0",
166 "redux-thunk": "^2.3.0",
167 "rn-fetch-blob": "^0.12.0",
168 "urbanairship-react-native": "^12.0.0",
169 "uuid": "^8.3.0"
170},
171
ANSWER
Answered 2022-Feb-25 at 23:22We have fixed the issue by replacing
1 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2 java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3 at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4 at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5 at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8 at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17 ext {
18 buildToolsVersion = "30.0.2"
19 minSdkVersion = 21
20 compileSdkVersion = 30
21 targetSdkVersion = 30
22 ndkVersion = "21.4.7075529"
23 }
24 repositories {
25 google()
26 mavenCentral()
27 jcenter()
28 // maven {
29 // url 'https://maven.fabric.io/public'
30 // }
31 maven { url "https://www.jitpack.io" }
32 }
33 dependencies {
34 classpath("com.android.tools.build:gradle:4.2.2")
35 classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
36 // Add the Fabric Crashlytics plugin.
37 // classpath 'io.fabric.tools:gradle:1.31.2'
38 // firebase performance sdk
39 classpath 'com.google.firebase:perf-plugin:1.4.0'
40 classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43 // NOTE: Do not place your application dependencies here; they belong
44 // in the individual module build.gradle files
45 }
46}
47
48allprojects {
49 repositories {
50 mavenCentral()
51 mavenLocal()
52 maven {
53 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54 url("$rootDir/../node_modules/react-native/android")
55 }
56 maven {
57 // Android JSC is installed from npm
58 url("$rootDir/../node_modules/jsc-android/dist")
59 }
60
61 google()
62 jcenter()
63 maven { url 'https://www.jitpack.io' }
64 }
65}
66
67
68subprojects {
69 afterEvaluate {project ->
70 if (project.hasProperty("android")) {
71 android {
72 buildToolsVersion "28.0.3"
73 compileSdkVersion 28
74 }
75 }
76 }
77}
78
79subprojects {
80 afterEvaluate {project ->
81 if (project.hasProperty("android")) {
82 android {
83 compileSdkVersion 29
84 buildToolsVersion '29.0.3'
85 }
86 }
87 }
88}
89"dependencies": {
90 "@eva-design/eva": "^2.1.0",
91 "@react-native-async-storage/async-storage": "^1.15.14",
92 "@react-native-community/blur": "^3.6.0",
93 "@react-native-community/checkbox": "^0.5.0",
94 "@react-native-community/netinfo": "^6.0.1",
95 "@react-native-community/toolbar-android": "^0.1.0-rc.2",
96 "@react-native-firebase/analytics": "^10.3.1",
97 "@react-native-firebase/app": "^10.3.0",
98 "@react-native-firebase/auth": "^10.3.1",
99 "@react-native-firebase/crashlytics": "^10.3.1",
100 "@react-native-firebase/dynamic-links": "^10.3.1",
101 "@react-native-firebase/firestore": "^10.3.1",
102 "@react-native-firebase/iid": "^10.3.1",
103 "@react-native-firebase/in-app-messaging": "^10.3.1",
104 "@react-native-firebase/messaging": "^10.3.1",
105 "@react-native-firebase/perf": "^10.3.1",
106 "@react-native-firebase/remote-config": "^10.3.1",
107 "@react-native-firebase/storage": "^10.3.1",
108 "@react-native-picker/picker": "^2.1.0",
109 "@react-navigation/bottom-tabs": "^6.0.9",
110 "@react-navigation/native": "^6.0.6",
111 "@react-navigation/stack": "^6.0.11",
112 "@types/react-native": "^0.65.5",
113 "@ui-kitten/components": "^5.1.0",
114 "axios": "^0.19.0",
115 "i18n-js": "^3.5.1",
116 "moment": "^2.24.0",
117 "native-base": "2.13.8",
118 "react": "17.0.2",
119 "react-content-loader": "^4.3.4",
120 "react-native": "0.66.0",
121 "react-native-actions-sheet": "^0.5.6",
122 "react-native-adjust": "^4.28.0",
123 "react-native-amplitude-analytics": "^0.2.7",
124 "react-native-animatable": "^1.3.3",
125 "react-native-code-push": "^7.0.4",
126 "react-native-config": "^1.3.3",
127 "react-native-contacts": "^5.0.7",
128 "react-native-dots-pagination": "^0.2.0",
129 "react-native-fbsdk-next": "^6.2.0",
130 "react-native-fingerprint-scanner": "^6.0.0",
131 "react-native-floating-action": "^1.22.0",
132 "react-native-geocoding": "^0.4.0",
133 "react-native-geolocation-service": "^5.2.0",
134 "react-native-gesture-handler": "^1.5.2",
135 "react-native-get-random-values": "^1.4.0",
136 "react-native-html-to-pdf-lite": "^0.11.0",
137 "react-native-image-base64": "^0.1.4",
138 "react-native-image-pan-zoom": "^2.1.11",
139 "react-native-image-picker": "^4.1.2",
140 "react-native-image-resizer": "^1.2.0",
141 "react-native-in-app-review": "^2.1.7",
142 "react-native-linear-gradient": "^2.5.6",
143 "react-native-loading-spinner-overlay": "^1.1.0",
144 "react-native-material-menu": "^1.0.0",
145 "react-native-material-textfield": "^0.16.1",
146 "react-native-modal": "^13.0.0",
147 "react-native-phone-call": "^1.0.9",
148 "react-native-ratings": "^7.3.0",
149 "react-native-reanimated": "^1.13.0",
150 "react-native-safe-area-context": "^3.3.2",
151 "react-native-screens": "^3.9.0",
152 "react-native-share": "^7.2.1",
153 "react-native-smooth-pincode-input": "^1.0.9",
154 "react-native-sms-retriever": "https://github.com/sarmad1995/react-native-sms-retriever.git",
155 "react-native-snap-carousel": "^3.9.1",
156 "react-native-splash-screen": "^3.2.0",
157 "react-native-svg": "^12.1.1",
158 "react-native-version-check": "^3.4.2",
159 "react-native-version-number": "^0.3.6",
160 "react-native-view-shot": "^3.1.2",
161 "react-native-walkthrough-tooltip": "^1.3.0",
162 "react-redux": "^7.1.3",
163 "redux": "^4.0.4",
164 "redux-logger": "^3.0.6",
165 "redux-persist": "^6.0.0",
166 "redux-thunk": "^2.3.0",
167 "rn-fetch-blob": "^0.12.0",
168 "urbanairship-react-native": "^12.0.0",
169 "uuid": "^8.3.0"
170},
171implementation 'com.facebook.android:facebook-marketing:[4,5)'
172
by
1 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
2 java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest; or its super classes (declaration of 'com.facebook.GraphRequest' appears in /data/app/~~aLf3pfLySq5u7zpIAr2Hlg==/com.package-name-99h4GcP3GNx2sMs76AXGvA==/base.apk)
3 at com.facebook.marketing.internal.RemoteConfigManager.getRemoteConfigQueryResponse(RemoteConfigManager.java:87)
4 at com.facebook.marketing.internal.RemoteConfigManager.access$000(RemoteConfigManager.java:43)
5 at com.facebook.marketing.internal.RemoteConfigManager$1.run(RemoteConfigManager.java:64)
6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
8 at java.lang.Thread.run(Thread.java:923)
9distributionBase=GRADLE_USER_HOME
10distributionPath=wrapper/dists
11distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
12zipStoreBase=GRADLE_USER_HOME
13zipStorePath=wrapper/dists
14// Top-level build file where you can add configuration options common to all sub-projects/modules.
15
16buildscript {
17 ext {
18 buildToolsVersion = "30.0.2"
19 minSdkVersion = 21
20 compileSdkVersion = 30
21 targetSdkVersion = 30
22 ndkVersion = "21.4.7075529"
23 }
24 repositories {
25 google()
26 mavenCentral()
27 jcenter()
28 // maven {
29 // url 'https://maven.fabric.io/public'
30 // }
31 maven { url "https://www.jitpack.io" }
32 }
33 dependencies {
34 classpath("com.android.tools.build:gradle:4.2.2")
35 classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
36 // Add the Fabric Crashlytics plugin.
37 // classpath 'io.fabric.tools:gradle:1.31.2'
38 // firebase performance sdk
39 classpath 'com.google.firebase:perf-plugin:1.4.0'
40 classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
41
42
43 // NOTE: Do not place your application dependencies here; they belong
44 // in the individual module build.gradle files
45 }
46}
47
48allprojects {
49 repositories {
50 mavenCentral()
51 mavenLocal()
52 maven {
53 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
54 url("$rootDir/../node_modules/react-native/android")
55 }
56 maven {
57 // Android JSC is installed from npm
58 url("$rootDir/../node_modules/jsc-android/dist")
59 }
60
61 google()
62 jcenter()
63 maven { url 'https://www.jitpack.io' }
64 }
65}
66
67
68subprojects {
69 afterEvaluate {project ->
70 if (project.hasProperty("android")) {
71 android {
72 buildToolsVersion "28.0.3"
73 compileSdkVersion 28
74 }
75 }
76 }
77}
78
79subprojects {
80 afterEvaluate {project ->
81 if (project.hasProperty("android")) {
82 android {
83 compileSdkVersion 29
84 buildToolsVersion '29.0.3'
85 }
86 }
87 }
88}
89"dependencies": {
90 "@eva-design/eva": "^2.1.0",
91 "@react-native-async-storage/async-storage": "^1.15.14",
92 "@react-native-community/blur": "^3.6.0",
93 "@react-native-community/checkbox": "^0.5.0",
94 "@react-native-community/netinfo": "^6.0.1",
95 "@react-native-community/toolbar-android": "^0.1.0-rc.2",
96 "@react-native-firebase/analytics": "^10.3.1",
97 "@react-native-firebase/app": "^10.3.0",
98 "@react-native-firebase/auth": "^10.3.1",
99 "@react-native-firebase/crashlytics": "^10.3.1",
100 "@react-native-firebase/dynamic-links": "^10.3.1",
101 "@react-native-firebase/firestore": "^10.3.1",
102 "@react-native-firebase/iid": "^10.3.1",
103 "@react-native-firebase/in-app-messaging": "^10.3.1",
104 "@react-native-firebase/messaging": "^10.3.1",
105 "@react-native-firebase/perf": "^10.3.1",
106 "@react-native-firebase/remote-config": "^10.3.1",
107 "@react-native-firebase/storage": "^10.3.1",
108 "@react-native-picker/picker": "^2.1.0",
109 "@react-navigation/bottom-tabs": "^6.0.9",
110 "@react-navigation/native": "^6.0.6",
111 "@react-navigation/stack": "^6.0.11",
112 "@types/react-native": "^0.65.5",
113 "@ui-kitten/components": "^5.1.0",
114 "axios": "^0.19.0",
115 "i18n-js": "^3.5.1",
116 "moment": "^2.24.0",
117 "native-base": "2.13.8",
118 "react": "17.0.2",
119 "react-content-loader": "^4.3.4",
120 "react-native": "0.66.0",
121 "react-native-actions-sheet": "^0.5.6",
122 "react-native-adjust": "^4.28.0",
123 "react-native-amplitude-analytics": "^0.2.7",
124 "react-native-animatable": "^1.3.3",
125 "react-native-code-push": "^7.0.4",
126 "react-native-config": "^1.3.3",
127 "react-native-contacts": "^5.0.7",
128 "react-native-dots-pagination": "^0.2.0",
129 "react-native-fbsdk-next": "^6.2.0",
130 "react-native-fingerprint-scanner": "^6.0.0",
131 "react-native-floating-action": "^1.22.0",
132 "react-native-geocoding": "^0.4.0",
133 "react-native-geolocation-service": "^5.2.0",
134 "react-native-gesture-handler": "^1.5.2",
135 "react-native-get-random-values": "^1.4.0",
136 "react-native-html-to-pdf-lite": "^0.11.0",
137 "react-native-image-base64": "^0.1.4",
138 "react-native-image-pan-zoom": "^2.1.11",
139 "react-native-image-picker": "^4.1.2",
140 "react-native-image-resizer": "^1.2.0",
141 "react-native-in-app-review": "^2.1.7",
142 "react-native-linear-gradient": "^2.5.6",
143 "react-native-loading-spinner-overlay": "^1.1.0",
144 "react-native-material-menu": "^1.0.0",
145 "react-native-material-textfield": "^0.16.1",
146 "react-native-modal": "^13.0.0",
147 "react-native-phone-call": "^1.0.9",
148 "react-native-ratings": "^7.3.0",
149 "react-native-reanimated": "^1.13.0",
150 "react-native-safe-area-context": "^3.3.2",
151 "react-native-screens": "^3.9.0",
152 "react-native-share": "^7.2.1",
153 "react-native-smooth-pincode-input": "^1.0.9",
154 "react-native-sms-retriever": "https://github.com/sarmad1995/react-native-sms-retriever.git",
155 "react-native-snap-carousel": "^3.9.1",
156 "react-native-splash-screen": "^3.2.0",
157 "react-native-svg": "^12.1.1",
158 "react-native-version-check": "^3.4.2",
159 "react-native-version-number": "^0.3.6",
160 "react-native-view-shot": "^3.1.2",
161 "react-native-walkthrough-tooltip": "^1.3.0",
162 "react-redux": "^7.1.3",
163 "redux": "^4.0.4",
164 "redux-logger": "^3.0.6",
165 "redux-persist": "^6.0.0",
166 "redux-thunk": "^2.3.0",
167 "rn-fetch-blob": "^0.12.0",
168 "urbanairship-react-native": "^12.0.0",
169 "uuid": "^8.3.0"
170},
171implementation 'com.facebook.android:facebook-marketing:[4,5)'
172implementation 'com.facebook.android:facebook-marketing:latest.release'
173
in android/app/build.gradle
file.
Posted this so someone out there facing the same problem will find the solution easily. It took me and my team around one and a half day to figure it out as there is no clear solution out there.
Solution Ref: here
QUESTION
How to register ServiceBusClient for dependency injection?
Asked 2022-Feb-08 at 14:11I’m trying to register ServiceBusClient
from the new Azure.Messaging.ServiceBus package for dependency injection as recommended in this article using ServiceBusClientBuilderExtensions
, but I can’t find any documentation or any help online on how exactly to go about this.
I'm trying to add as below
1public override void Configure(IFunctionsHostBuilder builder)
2{
3 ServiceBusClientBuilderExtensions.AddServiceBusClient(builder, Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary);
4}
5
but I'm getting the error
The type 'Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder' must be convertible to 'Azure.Core.Extensions.IAzureClientFactoryBuilder' in order to use it as parameter 'TBuilder' in the generic method 'IAzureClientBuilder<ServiceBusClient,ServiceBusClientOptions> Microsoft.Extensions.Azure.ServiceBusClientBuilderExtensions.AddServiceBusClient(this TBuilder, string)'
If anyone can help with this that'll be great!
ANSWER
Answered 2021-Sep-02 at 20:03ServiceBusClientBuilderExtensions.AddServiceBusClient
is an extension method of IAzureClientFactoryBuilder
:
1public override void Configure(IFunctionsHostBuilder builder)
2{
3 ServiceBusClientBuilderExtensions.AddServiceBusClient(builder, Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary);
4}
5public static IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions> AddServiceBusClient<TBuilder>(this TBuilder builder, string connectionString)
6 where TBuilder : IAzureClientFactoryBuilder
7
To get an instance of IAzureClientFactoryBuilder
, you need to call AzureClientServiceCollectionExtensions.AddAzureClients(IServiceCollection, Action<AzureClientFactoryBuilder>)
for a given IServiceCollection
, which provides a delegate giving an instance of IAzureClientFactoryBuilder
. (this method is in the Microsoft.Extensions.Azure
NuGet package)
To call that method, you can use the IServiceCollection
provided by IFunctionsHostBuilder
. With all of that, what you have should look something like:
1public override void Configure(IFunctionsHostBuilder builder)
2{
3 ServiceBusClientBuilderExtensions.AddServiceBusClient(builder, Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary);
4}
5public static IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions> AddServiceBusClient<TBuilder>(this TBuilder builder, string connectionString)
6 where TBuilder : IAzureClientFactoryBuilder
7public override void Configure(IFunctionsHostBuilder builder)
8{
9 builder.Services.AddAzureClients(clientsBuilder =>
10 {
11 clientsBuilder.AddServiceBusClient(Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary)
12 // (Optional) Provide name for instance to retrieve by with DI
13 .WithName("Client1Name")
14 // (Optional) Override ServiceBusClientOptions (e.g. change retry settings)
15 .ConfigureOptions(options =>
16 {
17 options.RetryOptions.Delay = TimeSpan.FromMilliseconds(50);
18 options.RetryOptions.MaxDelay = TimeSpan.FromSeconds(5);
19 options.RetryOptions.MaxRetries = 3;
20 });
21 });
22}
23
To retrieve the named instance, instead of using ServiceBusClient
as the injected type you use IAzureClientFactory<ServiceBusClient>
. The ServiceBusClient
is a Singleton regardless of whether you use a named instance or not.
1public override void Configure(IFunctionsHostBuilder builder)
2{
3 ServiceBusClientBuilderExtensions.AddServiceBusClient(builder, Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary);
4}
5public static IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions> AddServiceBusClient<TBuilder>(this TBuilder builder, string connectionString)
6 where TBuilder : IAzureClientFactoryBuilder
7public override void Configure(IFunctionsHostBuilder builder)
8{
9 builder.Services.AddAzureClients(clientsBuilder =>
10 {
11 clientsBuilder.AddServiceBusClient(Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary)
12 // (Optional) Provide name for instance to retrieve by with DI
13 .WithName("Client1Name")
14 // (Optional) Override ServiceBusClientOptions (e.g. change retry settings)
15 .ConfigureOptions(options =>
16 {
17 options.RetryOptions.Delay = TimeSpan.FromMilliseconds(50);
18 options.RetryOptions.MaxDelay = TimeSpan.FromSeconds(5);
19 options.RetryOptions.MaxRetries = 3;
20 });
21 });
22}
23 public Constructor(IAzureClientFactory<ServiceBusClient> serviceBusClientFactory)
24 {
25 // Wherever you need the ServiceBusClient
26 ServiceBusClient singletonClient1 = serviceBusClientFactory.CreateClient("Client1Name")
27 }
28
QUESTION
uploaded an APK which has an activity,activity alias,service or broadcast receiver with intentfilter, but without 'android : exported' property set
Asked 2022-Feb-03 at 10:56I'm having an issue when i'm uploading app bundle to the play console that You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. but my manifest file includes the property.
Manifest file
1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="**********">
4 <!-- io.flutter.app.FlutterApplication is an android.app.Application that
5 calls FlutterMain.startInitialization(this); in its onCreate method.
6 In most cases you can leave this as-is, but you if you want to provide
7 additional functionality it is fine to subclass or reimplement
8 FlutterApplication and put your custom class here. -->
9 <uses-permission android:name="android.permission.INTERNET" />
10 <uses-permission android:name="android.permission.CAMERA" />
11 <uses-feature android:name="android.hardware.camera" />
12 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
13 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
14 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
15 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
16 <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
17 <uses-permission android:name="android.permission.WAKE_LOCK"/>
18 <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
19 <uses-permission android:name="android.permission.VIBRATE" />
20 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
21 <uses-permission android:name="android.permission.WAKE_LOCK" />
22 <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
23 <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
24
25
26 <application
27 android:name="io.flutter.app.FlutterApplication"
28 android:label="*****"
29 android:requestLegacyExternalStorage="true"
30 android:usesCleartextTraffic="true"
31 android:icon="@mipmap/ic_launcher">
32
33
34 <meta-data
35 android:name="com.google.firebase.messaging.default_notification_icon"
36 android:resource="@drawable/ic_stat_artboard_1" />
37
38 <meta-data android:name="com.google.android.geo.API_KEY"
39 android:value="Z*********"/>
40
41 <provider
42 android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
43 android:authorities="im.mingguang.mingguang_app.flutter_downloader.provider"
44 android:grantUriPermissions="true"
45 android:requestLegacyExternalStorage="true">
46 <meta-data
47 android:name="android.support.FILE_PROVIDER_PATHS"
48 android:resource="@xml/provider_paths"/>
49 </provider>
50
51 <provider
52 android:name="androidx.core.content.FileProvider"
53 android:authorities="${applicationId}.provider"
54 android:grantUriPermissions="true">
55 <meta-data
56 android:name="android.support.FILE_PROVIDER_PATHS"
57 android:resource="@xml/provider_paths"/>
58 </provider>
59 <activity
60 android:name=".MainActivity"
61 android:launchMode="singleTop"
62 android:theme="@style/LaunchTheme"
63 android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
64 android:hardwareAccelerated="true"
65 android:exported="true"
66 android:windowSoftInputMode="adjustResize">
67 <intent-filter>
68 <action android:name="android.intent.action.MAIN"/>
69 <category android:name="android.intent.category.DEFAULT"/>
70 <category android:name="android.intent.category.LAUNCHER"/>
71 </intent-filter>
72 <intent-filter>
73 <action android:name="FLUTTER_NOTIFICATION_CLICK" />
74 <category android:name="android.intent.category.DEFAULT"/>
75 </intent-filter>
76 </activity>
77 <!-- Don't delete the meta-data below.
78 This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
79 <meta-data
80 android:name="flutterEmbedding"
81 android:value="2" />
82 </application>
83 </manifest>
84
Play Console Error
ANSWER
Answered 2022-Jan-12 at 23:56I face the same Issue but i solved by writing android:exported="true" in activity bellow the android:name=".MainActivity" image shown
QUESTION
How to solve FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore problem?
Asked 2022-Jan-11 at 15:08I am trying to set up Firebase with next.js. I am getting this error in the console.
FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore
This is one of my custom hook
1import { onAuthStateChanged, User } from '@firebase/auth'
2import { doc, onSnapshot, Unsubscribe } from 'firebase/firestore'
3import { useEffect, useState } from 'react'
4import { auth, fireStore } from './firebase'
5
6export const useUserData = () => {
7 const [username, setUsername] = useState<string | null>(null)
8
9 const [currentUser, setCurrentUser] = useState<User | null>(null)
10
11 useEffect(() => {
12 let unsubscribe: void | Unsubscribe
13
14 onAuthStateChanged(auth, (user) => {
15 if (user) {
16 setCurrentUser(user)
17 // The Problem is inside this try blog
18 try {
19 // the onsnapshot function is causing the problem
20 console.log('firestore: ', fireStore)
21 unsubscribe = onSnapshot(doc(fireStore, 'users', user.uid), (doc) => {
22 setUsername(doc.data()?.username)
23 })
24 } catch (e) {
25 console.log(e.message)
26 }
27 } else {
28 setCurrentUser(null)
29 setUsername(null)
30 }
31 })
32
33 return unsubscribe
34 }, [currentUser])
35
36 return { currentUser, username }
37}
38
I also have this firebase.ts file where I initialized my firebase app
1import { onAuthStateChanged, User } from '@firebase/auth'
2import { doc, onSnapshot, Unsubscribe } from 'firebase/firestore'
3import { useEffect, useState } from 'react'
4import { auth, fireStore } from './firebase'
5
6export const useUserData = () => {
7 const [username, setUsername] = useState<string | null>(null)
8
9 const [currentUser, setCurrentUser] = useState<User | null>(null)
10
11 useEffect(() => {
12 let unsubscribe: void | Unsubscribe
13
14 onAuthStateChanged(auth, (user) => {
15 if (user) {
16 setCurrentUser(user)
17 // The Problem is inside this try blog
18 try {
19 // the onsnapshot function is causing the problem
20 console.log('firestore: ', fireStore)
21 unsubscribe = onSnapshot(doc(fireStore, 'users', user.uid), (doc) => {
22 setUsername(doc.data()?.username)
23 })
24 } catch (e) {
25 console.log(e.message)
26 }
27 } else {
28 setCurrentUser(null)
29 setUsername(null)
30 }
31 })
32
33 return unsubscribe
34 }, [currentUser])
35
36 return { currentUser, username }
37}
38import { FirebaseApp, getApps, initializeApp } from 'firebase/app'
39import { getAuth } from 'firebase/auth'
40import { getFirestore } from 'firebase/firestore/lite'
41import { getStorage } from 'firebase/storage'
42
43const firebaseConfig = {
44 apiKey: 'some-api',
45 authDomain: 'some-auth-domain',
46 projectId: 'some-project-id',
47 storageBucket: 'some-storage-bucket',
48 messagingSenderId: 'some-id',
49 appId: 'some-app-id',
50 measurementId: 'some-measurement-id',
51}
52
53let firebaseApp: FirebaseApp
54
55if (!getApps.length) {
56 firebaseApp = initializeApp(firebaseConfig)
57}
58
59const fireStore = getFirestore(firebaseApp)
60const auth = getAuth(firebaseApp)
61const storage = getStorage(firebaseApp)
62
63export { fireStore, auth, storage }
64
I don't know whether the problem is in the project initialization. I am pretty sure the error is generated from my custom hook file. I also found out that there must be something wrong with onSnapshot
function. Am I passing the docRef wrong or something? What am I doing wrong here?
The console.log(firestore)
log:
1import { onAuthStateChanged, User } from '@firebase/auth'
2import { doc, onSnapshot, Unsubscribe } from 'firebase/firestore'
3import { useEffect, useState } from 'react'
4import { auth, fireStore } from './firebase'
5
6export const useUserData = () => {
7 const [username, setUsername] = useState<string | null>(null)
8
9 const [currentUser, setCurrentUser] = useState<User | null>(null)
10
11 useEffect(() => {
12 let unsubscribe: void | Unsubscribe
13
14 onAuthStateChanged(auth, (user) => {
15 if (user) {
16 setCurrentUser(user)
17 // The Problem is inside this try blog
18 try {
19 // the onsnapshot function is causing the problem
20 console.log('firestore: ', fireStore)
21 unsubscribe = onSnapshot(doc(fireStore, 'users', user.uid), (doc) => {
22 setUsername(doc.data()?.username)
23 })
24 } catch (e) {
25 console.log(e.message)
26 }
27 } else {
28 setCurrentUser(null)
29 setUsername(null)
30 }
31 })
32
33 return unsubscribe
34 }, [currentUser])
35
36 return { currentUser, username }
37}
38import { FirebaseApp, getApps, initializeApp } from 'firebase/app'
39import { getAuth } from 'firebase/auth'
40import { getFirestore } from 'firebase/firestore/lite'
41import { getStorage } from 'firebase/storage'
42
43const firebaseConfig = {
44 apiKey: 'some-api',
45 authDomain: 'some-auth-domain',
46 projectId: 'some-project-id',
47 storageBucket: 'some-storage-bucket',
48 messagingSenderId: 'some-id',
49 appId: 'some-app-id',
50 measurementId: 'some-measurement-id',
51}
52
53let firebaseApp: FirebaseApp
54
55if (!getApps.length) {
56 firebaseApp = initializeApp(firebaseConfig)
57}
58
59const fireStore = getFirestore(firebaseApp)
60const auth = getAuth(firebaseApp)
61const storage = getStorage(firebaseApp)
62
63export { fireStore, auth, storage }
64
65 type: "firestore-lite"
66 _app: FirebaseAppImpl
67 _automaticDataCollectionEnabled: false
68 _config: {name: "[DEFAULT]", automaticDataCollectionEnabled: false}
69 _container: ComponentContainer {name: "[DEFAULT]", providers: Map(15)}
70 _isDeleted: false
71 _name: "[DEFAULT]"
72 _options:
73 apiKey: 'some-api'
74 authDomain: 'some-auth-domain'
75 projectId: 'some-project-id'
76 storageBucket: 'some-storage-bucket'
77 messagingSenderId: 'some-id'
78 appId: 'some-app-id'
79 measurementId: 'some-measurement-id'
80 [[Prototype]]: Object
81 automaticDataCollectionEnabled: (...)
82 config: (...)
83 container: (...)
84 isDeleted: (...)
85 name: (...)
86 options: (...)
87 [[Prototype]]: Object
88 _credentials: Q {auth: AuthInterop}
89 _databaseId: H {projectId: "next-firebase-fireship", database: "(default)"}
90 _persistenceKey: "(lite)"
91 _settings: ee {host: "firestore.googleapis.com", ssl: true, credentials: undefined, ignoreUndefinedProperties: false, cacheSizeBytes: 41943040, …}
92 _settingsFrozen: false
93 app: (...)
94 _initialized: (...)
95 _terminated: (...)
96
97
ANSWER
Answered 2022-Jan-07 at 19:07Using getFirestore
from lite
library will not work with onSnapshot
. You are importing getFirestore
from lite
version:
1import { onAuthStateChanged, User } from '@firebase/auth'
2import { doc, onSnapshot, Unsubscribe } from 'firebase/firestore'
3import { useEffect, useState } from 'react'
4import { auth, fireStore } from './firebase'
5
6export const useUserData = () => {
7 const [username, setUsername] = useState<string | null>(null)
8
9 const [currentUser, setCurrentUser] = useState<User | null>(null)
10
11 useEffect(() => {
12 let unsubscribe: void | Unsubscribe
13
14 onAuthStateChanged(auth, (user) => {
15 if (user) {
16 setCurrentUser(user)
17 // The Problem is inside this try blog
18 try {
19 // the onsnapshot function is causing the problem
20 console.log('firestore: ', fireStore)
21 unsubscribe = onSnapshot(doc(fireStore, 'users', user.uid), (doc) => {
22 setUsername(doc.data()?.username)
23 })
24 } catch (e) {
25 console.log(e.message)
26 }
27 } else {
28 setCurrentUser(null)
29 setUsername(null)
30 }
31 })
32
33 return unsubscribe
34 }, [currentUser])
35
36 return { currentUser, username }
37}
38import { FirebaseApp, getApps, initializeApp } from 'firebase/app'
39import { getAuth } from 'firebase/auth'
40import { getFirestore } from 'firebase/firestore/lite'
41import { getStorage } from 'firebase/storage'
42
43const firebaseConfig = {
44 apiKey: 'some-api',
45 authDomain: 'some-auth-domain',
46 projectId: 'some-project-id',
47 storageBucket: 'some-storage-bucket',
48 messagingSenderId: 'some-id',
49 appId: 'some-app-id',
50 measurementId: 'some-measurement-id',
51}
52
53let firebaseApp: FirebaseApp
54
55if (!getApps.length) {
56 firebaseApp = initializeApp(firebaseConfig)
57}
58
59const fireStore = getFirestore(firebaseApp)
60const auth = getAuth(firebaseApp)
61const storage = getStorage(firebaseApp)
62
63export { fireStore, auth, storage }
64
65 type: "firestore-lite"
66 _app: FirebaseAppImpl
67 _automaticDataCollectionEnabled: false
68 _config: {name: "[DEFAULT]", automaticDataCollectionEnabled: false}
69 _container: ComponentContainer {name: "[DEFAULT]", providers: Map(15)}
70 _isDeleted: false
71 _name: "[DEFAULT]"
72 _options:
73 apiKey: 'some-api'
74 authDomain: 'some-auth-domain'
75 projectId: 'some-project-id'
76 storageBucket: 'some-storage-bucket'
77 messagingSenderId: 'some-id'
78 appId: 'some-app-id'
79 measurementId: 'some-measurement-id'
80 [[Prototype]]: Object
81 automaticDataCollectionEnabled: (...)
82 config: (...)
83 container: (...)
84 isDeleted: (...)
85 name: (...)
86 options: (...)
87 [[Prototype]]: Object
88 _credentials: Q {auth: AuthInterop}
89 _databaseId: H {projectId: "next-firebase-fireship", database: "(default)"}
90 _persistenceKey: "(lite)"
91 _settings: ee {host: "firestore.googleapis.com", ssl: true, credentials: undefined, ignoreUndefinedProperties: false, cacheSizeBytes: 41943040, …}
92 _settingsFrozen: false
93 app: (...)
94 _initialized: (...)
95 _terminated: (...)
96
97import { getFirestore } from 'firebase/firestore/lite'
98
Change the import to:
1import { onAuthStateChanged, User } from '@firebase/auth'
2import { doc, onSnapshot, Unsubscribe } from 'firebase/firestore'
3import { useEffect, useState } from 'react'
4import { auth, fireStore } from './firebase'
5
6export const useUserData = () => {
7 const [username, setUsername] = useState<string | null>(null)
8
9 const [currentUser, setCurrentUser] = useState<User | null>(null)
10
11 useEffect(() => {
12 let unsubscribe: void | Unsubscribe
13
14 onAuthStateChanged(auth, (user) => {
15 if (user) {
16 setCurrentUser(user)
17 // The Problem is inside this try blog
18 try {
19 // the onsnapshot function is causing the problem
20 console.log('firestore: ', fireStore)
21 unsubscribe = onSnapshot(doc(fireStore, 'users', user.uid), (doc) => {
22 setUsername(doc.data()?.username)
23 })
24 } catch (e) {
25 console.log(e.message)
26 }
27 } else {
28 setCurrentUser(null)
29 setUsername(null)
30 }
31 })
32
33 return unsubscribe
34 }, [currentUser])
35
36 return { currentUser, username }
37}
38import { FirebaseApp, getApps, initializeApp } from 'firebase/app'
39import { getAuth } from 'firebase/auth'
40import { getFirestore } from 'firebase/firestore/lite'
41import { getStorage } from 'firebase/storage'
42
43const firebaseConfig = {
44 apiKey: 'some-api',
45 authDomain: 'some-auth-domain',
46 projectId: 'some-project-id',
47 storageBucket: 'some-storage-bucket',
48 messagingSenderId: 'some-id',
49 appId: 'some-app-id',
50 measurementId: 'some-measurement-id',
51}
52
53let firebaseApp: FirebaseApp
54
55if (!getApps.length) {
56 firebaseApp = initializeApp(firebaseConfig)
57}
58
59const fireStore = getFirestore(firebaseApp)
60const auth = getAuth(firebaseApp)
61const storage = getStorage(firebaseApp)
62
63export { fireStore, auth, storage }
64
65 type: "firestore-lite"
66 _app: FirebaseAppImpl
67 _automaticDataCollectionEnabled: false
68 _config: {name: "[DEFAULT]", automaticDataCollectionEnabled: false}
69 _container: ComponentContainer {name: "[DEFAULT]", providers: Map(15)}
70 _isDeleted: false
71 _name: "[DEFAULT]"
72 _options:
73 apiKey: 'some-api'
74 authDomain: 'some-auth-domain'
75 projectId: 'some-project-id'
76 storageBucket: 'some-storage-bucket'
77 messagingSenderId: 'some-id'
78 appId: 'some-app-id'
79 measurementId: 'some-measurement-id'
80 [[Prototype]]: Object
81 automaticDataCollectionEnabled: (...)
82 config: (...)
83 container: (...)
84 isDeleted: (...)
85 name: (...)
86 options: (...)
87 [[Prototype]]: Object
88 _credentials: Q {auth: AuthInterop}
89 _databaseId: H {projectId: "next-firebase-fireship", database: "(default)"}
90 _persistenceKey: "(lite)"
91 _settings: ee {host: "firestore.googleapis.com", ssl: true, credentials: undefined, ignoreUndefinedProperties: false, cacheSizeBytes: 41943040, …}
92 _settingsFrozen: false
93 app: (...)
94 _initialized: (...)
95 _terminated: (...)
96
97import { getFirestore } from 'firebase/firestore/lite'
98import { getFirestore } from 'firebase/firestore'
99
From the documentation,
The
onSnapshot
method andDocumentChange
,SnapshotListenerOptions
,SnapshotMetadata
,SnapshotOptions
andUnsubscribe
objects are not included inlite
version.
Another reason for this error to show up could be passing invalid first argument to collection()
or doc()
functions. They both take a Firestore instance as first argument.
1import { onAuthStateChanged, User } from '@firebase/auth'
2import { doc, onSnapshot, Unsubscribe } from 'firebase/firestore'
3import { useEffect, useState } from 'react'
4import { auth, fireStore } from './firebase'
5
6export const useUserData = () => {
7 const [username, setUsername] = useState<string | null>(null)
8
9 const [currentUser, setCurrentUser] = useState<User | null>(null)
10
11 useEffect(() => {
12 let unsubscribe: void | Unsubscribe
13
14 onAuthStateChanged(auth, (user) => {
15 if (user) {
16 setCurrentUser(user)
17 // The Problem is inside this try blog
18 try {
19 // the onsnapshot function is causing the problem
20 console.log('firestore: ', fireStore)
21 unsubscribe = onSnapshot(doc(fireStore, 'users', user.uid), (doc) => {
22 setUsername(doc.data()?.username)
23 })
24 } catch (e) {
25 console.log(e.message)
26 }
27 } else {
28 setCurrentUser(null)
29 setUsername(null)
30 }
31 })
32
33 return unsubscribe
34 }, [currentUser])
35
36 return { currentUser, username }
37}
38import { FirebaseApp, getApps, initializeApp } from 'firebase/app'
39import { getAuth } from 'firebase/auth'
40import { getFirestore } from 'firebase/firestore/lite'
41import { getStorage } from 'firebase/storage'
42
43const firebaseConfig = {
44 apiKey: 'some-api',
45 authDomain: 'some-auth-domain',
46 projectId: 'some-project-id',
47 storageBucket: 'some-storage-bucket',
48 messagingSenderId: 'some-id',
49 appId: 'some-app-id',
50 measurementId: 'some-measurement-id',
51}
52
53let firebaseApp: FirebaseApp
54
55if (!getApps.length) {
56 firebaseApp = initializeApp(firebaseConfig)
57}
58
59const fireStore = getFirestore(firebaseApp)
60const auth = getAuth(firebaseApp)
61const storage = getStorage(firebaseApp)
62
63export { fireStore, auth, storage }
64
65 type: "firestore-lite"
66 _app: FirebaseAppImpl
67 _automaticDataCollectionEnabled: false
68 _config: {name: "[DEFAULT]", automaticDataCollectionEnabled: false}
69 _container: ComponentContainer {name: "[DEFAULT]", providers: Map(15)}
70 _isDeleted: false
71 _name: "[DEFAULT]"
72 _options:
73 apiKey: 'some-api'
74 authDomain: 'some-auth-domain'
75 projectId: 'some-project-id'
76 storageBucket: 'some-storage-bucket'
77 messagingSenderId: 'some-id'
78 appId: 'some-app-id'
79 measurementId: 'some-measurement-id'
80 [[Prototype]]: Object
81 automaticDataCollectionEnabled: (...)
82 config: (...)
83 container: (...)
84 isDeleted: (...)
85 name: (...)
86 options: (...)
87 [[Prototype]]: Object
88 _credentials: Q {auth: AuthInterop}
89 _databaseId: H {projectId: "next-firebase-fireship", database: "(default)"}
90 _persistenceKey: "(lite)"
91 _settings: ee {host: "firestore.googleapis.com", ssl: true, credentials: undefined, ignoreUndefinedProperties: false, cacheSizeBytes: 41943040, …}
92 _settingsFrozen: false
93 app: (...)
94 _initialized: (...)
95 _terminated: (...)
96
97import { getFirestore } from 'firebase/firestore/lite'
98import { getFirestore } from 'firebase/firestore'
99// Ensure that "db" is defined and initialized
100const db = getFirestore();
101// console.log(db);
102
103const colRef = collection(db, "collection_name");
104
QUESTION
Mandatory Consent for Admob User Messaging Platform
Asked 2021-Dec-12 at 16:09I switched from the deprecated GDPR Consent Library to the new User Messaging Platform, and used the code as stated in the documentation.
I noticed that when the user clicks on Manage Options then Confirm choices, ads will stop displaying altogether (Ad failed to load, no ad config), and I can't find anyway to check if the user didn't consent to the use of personal data.
This is problematic as my app relies purely on ads, and I will be losing money if ads don't show up, so I want to make it mandatory for users to consent to the use of their personal data, otherwise the app should be unusable.
I have made a test project on Github so everyone can test this behavior. If you are not using an emulator, then you need to change the "TEST_DEVICE_ID" to yours.
How can I achieve this?
ANSWER
Answered 2021-Nov-02 at 17:50I found a workaround for this, but this is no final official solution.
It seems that if a user consented to Personalized ads, a string in SharedPreferences
, which key is IABTCF_VendorConsents, will contain ones and zeros corresponding to some vendors (I think). If he didn't consent, this string will be equal to 0.
1private val sp = PreferenceManager.getDefaultSharedPreferences(appContext)
2fun consentedToPersonalizedAds() = sp.getString("IABTCF_VendorConsents", null) != "0"
3
QUESTION
MissingPluginException(No implementation found for method Messaging#requestPermission on channel firebase_messaging
Asked 2021-Dec-07 at 05:131final NotificationSettings settings = await messaging.requestPermission();
2
I am getting this error when calling requestPermission() method of firebase messaging.
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method Messaging#requestPermission on channel plugins.flutter.io/firebase_messaging) E/flutter ( 7180): #0 convertPlatformException (package:firebase_messaging_platform_interface/src/method_channel/utils/exception.dart:13:5) E/flutter ( 7180): #1 MethodChannelFirebaseMessaging.requestPermission (package:firebase_messaging_platform_interface/src/method_channel/method_channel_messaging.dart:286:13) E/flutter ( 7180):
In build.gradle i implemented 'com.google.firebase:firebase-messaging'
implementation platform('com.google.firebase:firebase-bom:28.3.0')
ANSWER
Answered 2021-Nov-08 at 09:11Terminate the current running session.
Do flutter pub get
in your terminal
Then run again.
QUESTION
Error in retrieving notification_key for group messaging in FCM
Asked 2021-Aug-22 at 06:09I was able to create a notification_key
from notification_key_name
as mentioned in the docs.
However, when I went to retrieving the notification_key
from notification_key_name
using
I get the error:
Your client has issued a malformed or illegal request.
What am I doing wrong?
ANSWER
Answered 2021-Aug-22 at 06:09QUESTION
Firestore Push Notification "time out" error Notification doesn't always get sent
Asked 2021-Jul-13 at 09:43I am calling a function from my app that sends a notification out to a specific user on the app. The notification gets sent successfully much of the time but a good amount of times it does not get sent. When it does not get sent I check the logs to see
Function execution took 60003 ms, finished with status: 'timeout'
I have tried playing with my promises / async await but have had no luck as I suspect that is where the issue lies.
Here is what my cloud code looks like now
1exports.sendNotification = functions.https.onRequest(async (request, response) => {
2
3 if (request.method !== "POST") {
4 response.status(400).send("Send it using post request");
5 return;
6 }
7
8 var toUid = request.body.toUid
9 var fcm = request.body.fcm
10 var fromUid = request.body.fromUid
11 var type = request.body.type
12 var fromName = request.body.fromName
13 var messageText = request.body.message
14
15 if (toUid === "" || fromUid === "" || fcm === "") {
16 response.status(400).send("Parameter is missing!");
17 return;
18 }
19
20 // common data for both platforms
21 const notification = {
22 title: fromName,
23 body: messageText,
24 }
25 const fcmToken = fcm
26
27 // ios specific headers
28 const apns = {
29 headers: {
30 "apns-collapse-id": 'toUid'
31 },
32 payload: {
33 aps: {
34 sound: 'default'
35 },
36 "data": {
37 "fromUid": fromUid,
38 "type": type
39 }
40 }
41 }
42
43 // final message
44 const message = {
45 token: fcmToken,
46 notification: notification,
47 apns: apns,
48 }
49
50 // send message
51 try {
52 return await admin.messaging().send(message);
53 response.status(200).send("Done");
54 } catch(e) {
55 console.log('Error sending message:', e);
56 }
57});
58
I call the function from the app as follows
1exports.sendNotification = functions.https.onRequest(async (request, response) => {
2
3 if (request.method !== "POST") {
4 response.status(400).send("Send it using post request");
5 return;
6 }
7
8 var toUid = request.body.toUid
9 var fcm = request.body.fcm
10 var fromUid = request.body.fromUid
11 var type = request.body.type
12 var fromName = request.body.fromName
13 var messageText = request.body.message
14
15 if (toUid === "" || fromUid === "" || fcm === "") {
16 response.status(400).send("Parameter is missing!");
17 return;
18 }
19
20 // common data for both platforms
21 const notification = {
22 title: fromName,
23 body: messageText,
24 }
25 const fcmToken = fcm
26
27 // ios specific headers
28 const apns = {
29 headers: {
30 "apns-collapse-id": 'toUid'
31 },
32 payload: {
33 aps: {
34 sound: 'default'
35 },
36 "data": {
37 "fromUid": fromUid,
38 "type": type
39 }
40 }
41 }
42
43 // final message
44 const message = {
45 token: fcmToken,
46 notification: notification,
47 apns: apns,
48 }
49
50 // send message
51 try {
52 return await admin.messaging().send(message);
53 response.status(200).send("Done");
54 } catch(e) {
55 console.log('Error sending message:', e);
56 }
57});
58 AF.request("https://myproject.net/sendNotification", method: .post, parameters: parameters, encoding: JSONEncoding.default)
59 .responseString { response in
60 print(response)
61 DispatchQueue.main.async {
62 completion("done")
63 }
64 }
65
I have seen other stackoverflow questions of similar questions where it was suggested to use .post and JSONEncoding.default and so that is what I have now.
ANSWER
Answered 2021-Jul-06 at 17:40I'm no node expert by any means, but played with Firebase Messaging for a while and came up with a working async solution to send a notification based on data creation in the realtime db. The only other difference aside from the trigger I really see is I'm not sending the APNS specific header yet...
I'm also remembering now I was having an intermittent timeout issue when I tried using the async messaging.send
which is why I'm using promises there.
1exports.sendNotification = functions.https.onRequest(async (request, response) => {
2
3 if (request.method !== "POST") {
4 response.status(400).send("Send it using post request");
5 return;
6 }
7
8 var toUid = request.body.toUid
9 var fcm = request.body.fcm
10 var fromUid = request.body.fromUid
11 var type = request.body.type
12 var fromName = request.body.fromName
13 var messageText = request.body.message
14
15 if (toUid === "" || fromUid === "" || fcm === "") {
16 response.status(400).send("Parameter is missing!");
17 return;
18 }
19
20 // common data for both platforms
21 const notification = {
22 title: fromName,
23 body: messageText,
24 }
25 const fcmToken = fcm
26
27 // ios specific headers
28 const apns = {
29 headers: {
30 "apns-collapse-id": 'toUid'
31 },
32 payload: {
33 aps: {
34 sound: 'default'
35 },
36 "data": {
37 "fromUid": fromUid,
38 "type": type
39 }
40 }
41 }
42
43 // final message
44 const message = {
45 token: fcmToken,
46 notification: notification,
47 apns: apns,
48 }
49
50 // send message
51 try {
52 return await admin.messaging().send(message);
53 response.status(200).send("Done");
54 } catch(e) {
55 console.log('Error sending message:', e);
56 }
57});
58 AF.request("https://myproject.net/sendNotification", method: .post, parameters: parameters, encoding: JSONEncoding.default)
59 .responseString { response in
60 print(response)
61 DispatchQueue.main.async {
62 completion("done")
63 }
64 }
65exports.onMessageCreate = functions.database
66.ref('/users/{userId}/notifications/unread/{notificationId}')
67.onCreate(async (snapshot, context) => {
68
69 const message = snapshot.val()
70 const category = message.category
71 const title = category + ": " + message.title
72 const text = message.text
73 const forUserId = message.forUserId
74 const date = message.date
75
76 const token = await getUserToken(forUserId)
77
78 if (token == null) {
79 throw new functions.https.HttpsError('unavailable', 'The token is nil, unable to send message')
80 }
81
82 const notification = {
83 notification: {
84 title: title,
85 body: text
86 },
87 data: {
88 category: category,
89 title: message.title,
90 text: text,
91 forUserId: forUserId,
92 date: date.toString()
93 },
94 token: token
95 }
96
97 return admin.messaging().send(notification)
98 .then((response) => {
99 console.log('Successfully sent notification:', response)
100 })
101 .catch((error) => {
102 console.log('Error sending notification:', error)
103 })
104
105})
106
QUESTION
Google AdMob new SDK setup for iOS : SKAdNetworkItems, NSUserTrackingUsageDescription, ATTrackingManager. Guideline 5.1.2 - Legal - Privacy - Data Use
Asked 2021-May-25 at 17:38Google AdMob now shows below warning.
Prepare your apps for iOS 14 Apple announced the new AppTrackingTransparency framework, which requires changes to your iOS apps. Implement the GMA SDK 7.64.0 (or later) and set up consent messaging to help prevent a significant loss in ad revenue.
Some apps haven't been configured to use Apple's SKAdNetwork To ensure you're getting credit for all ads activity, like app installs, be sure to configure SKAdNetwork with Google's network IDs.
Some of your iOS apps require a GMA SDK update To keep ads serving normally and minimize a loss in ad revenue, implement the GMA SDK 7.64.0 (or later) for your iOS apps. And configure the SKAdNetwork in your apps with Google's network ID.
For this I did these changes
2.Updated app's Info.plist file with these 3 keys:
1 1. GADApplicationIdentifier key with a string value of AdMob app ID.
2 2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3 3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
4
1 1. GADApplicationIdentifier key with a string value of AdMob app ID.
2 2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3 3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
4- (void)requestIDFA
5{
6 if (@available(iOS 14.0, *))
7 {
8 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
9
10 // Admob Ads
11 [self loadAdmob_Ads];
12 [self loadRewardedInterstitial];
13 [self requestAppOpenAd];
14 }];
15 }
16 else
17 {
18 // Admob Ads
19 [self loadAdmob_Ads];
20 [self loadRewardedInterstitial];
21 [self requestAppOpenAd];
22 }
23}
24
Is there anything else I need to do in Xcode ?
See below image from Appstoreconnect, Am I need to set Yes Or No?(Yes, we use advertising data for tracking purpose?) we are not tracking user, not sure about Google AdMob.
Data Used to Track You ( Identifiers), Data Linked to You ( Identifiers ). Is it right settings for Google AdMob ?
Recent AppStore Rejection Message:
Guideline 5.1.2 - Legal - Privacy - Data Use and Sharing
We noticed you do not use App Tracking Transparency to request the user's permission before tracking their activity across apps and websites. The app privacy information you provided in App Store Connect indicates you collect data in order to track the user, including Device ID and Advertising Data.
Starting with iOS 14.5, apps on the App Store need to receive the user’s permission through the AppTrackingTransparency framework before collecting data used to track them. This requirement protects the privacy of App Store users.
Updates: Game approved by Apple. Here is game with latest admob ads (GADInterstitialAd, GADAppOpenAd, GADRewardedInterstitialAd, GADRewardedAd): https://apps.apple.com/us/app/ocean-fishing-master-3d-games/id1550945081
ANSWER
Answered 2021-May-25 at 17:37Updates: Game approved by Apple. Here is game with latest admob ads (GADInterstitialAd, GADRewardedInterstitialAd, GADRewardedAd, GADAppOpenAd):
https://apps.apple.com/us/app/ocean-fishing-master-3d-games/id1550945081
Added Google Admob SKAdNetworkIdentifier values in Info.plist
1 1. GADApplicationIdentifier key with a string value of AdMob app ID.
2 2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3 3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
4- (void)requestIDFA
5{
6 if (@available(iOS 14.0, *))
7 {
8 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
9
10 // Admob Ads
11 [self loadAdmob_Ads];
12 [self loadRewardedInterstitial];
13 [self requestAppOpenAd];
14 }];
15 }
16 else
17 {
18 // Admob Ads
19 [self loadAdmob_Ads];
20 [self loadRewardedInterstitial];
21 [self requestAppOpenAd];
22 }
23}
24<key>SKAdNetworkItems</key>
25 <array>
26 <dict>
27 <key>SKAdNetworkIdentifier</key>
28 <string>cstr6suwn9.skadnetwork</string>
29 </dict>
30 <dict>
31 <key>SKAdNetworkIdentifier</key>
32 <string>4fzdc2evr5.skadnetwork</string>
33 </dict>
34 <dict>
35 <key>SKAdNetworkIdentifier</key>
36 <string>2fnua5tdw4.skadnetwork</string>
37 </dict>
38 <dict>
39 <key>SKAdNetworkIdentifier</key>
40 <string>ydx93a7ass.skadnetwork</string>
41 </dict>
42 <dict>
43 <key>SKAdNetworkIdentifier</key>
44 <string>5a6flpkh64.skadnetwork</string>
45 </dict>
46 <dict>
47 <key>SKAdNetworkIdentifier</key>
48 <string>p78axxw29g.skadnetwork</string>
49 </dict>
50 <dict>
51 <key>SKAdNetworkIdentifier</key>
52 <string>v72qych5uu.skadnetwork</string>
53 </dict>
54 <dict>
55 <key>SKAdNetworkIdentifier</key>
56 <string>c6k4g5qg8m.skadnetwork</string>
57 </dict>
58 <dict>
59 <key>SKAdNetworkIdentifier</key>
60 <string>s39g8k73mm.skadnetwork</string>
61 </dict>
62 <dict>
63 <key>SKAdNetworkIdentifier</key>
64 <string>3qy4746246.skadnetwork</string>
65 </dict>
66 <dict>
67 <key>SKAdNetworkIdentifier</key>
68 <string>3sh42y64q3.skadnetwork</string>
69 </dict>
70 <dict>
71 <key>SKAdNetworkIdentifier</key>
72 <string>f38h382jlk.skadnetwork</string>
73 </dict>
74 <dict>
75 <key>SKAdNetworkIdentifier</key>
76 <string>hs6bdukanm.skadnetwork</string>
77 </dict>
78 <dict>
79 <key>SKAdNetworkIdentifier</key>
80 <string>prcb7njmu6.skadnetwork</string>
81 </dict>
82 <dict>
83 <key>SKAdNetworkIdentifier</key>
84 <string>wzmmz9fp6w.skadnetwork</string>
85 </dict>
86 <dict>
87 <key>SKAdNetworkIdentifier</key>
88 <string>yclnxrl5pm.skadnetwork</string>
89 </dict>
90 <dict>
91 <key>SKAdNetworkIdentifier</key>
92 <string>4468km3ulz.skadnetwork</string>
93 </dict>
94 <dict>
95 <key>SKAdNetworkIdentifier</key>
96 <string>t38b2kh725.skadnetwork</string>
97 </dict>
98 <dict>
99 <key>SKAdNetworkIdentifier</key>
100 <string>7ug5zh24hu.skadnetwork</string>
101 </dict>
102 <dict>
103 <key>SKAdNetworkIdentifier</key>
104 <string>9rd848q2bz.skadnetwork</string>
105 </dict>
106 <dict>
107 <key>SKAdNetworkIdentifier</key>
108 <string>n6fk4nfna4.skadnetwork</string>
109 </dict>
110 <dict>
111 <key>SKAdNetworkIdentifier</key>
112 <string>kbd757ywx3.skadnetwork</string>
113 </dict>
114 <dict>
115 <key>SKAdNetworkIdentifier</key>
116 <string>9t245vhmpl.skadnetwork</string>
117 </dict>
118 <dict>
119 <key>SKAdNetworkIdentifier</key>
120 <string>2u9pt9hc89.skadnetwork</string>
121 </dict>
122 <dict>
123 <key>SKAdNetworkIdentifier</key>
124 <string>8s468mfl3y.skadnetwork</string>
125 </dict>
126 <dict>
127 <key>SKAdNetworkIdentifier</key>
128 <string>av6w8kgt66.skadnetwork</string>
129 </dict>
130 <dict>
131 <key>SKAdNetworkIdentifier</key>
132 <string>klf5c3l5u5.skadnetwork</string>
133 </dict>
134 <dict>
135 <key>SKAdNetworkIdentifier</key>
136 <string>ppxm28t8ap.skadnetwork</string>
137 </dict>
138 <dict>
139 <key>SKAdNetworkIdentifier</key>
140 <string>424m5254lk.skadnetwork</string>
141 </dict>
142 <dict>
143 <key>SKAdNetworkIdentifier</key>
144 <string>uw77j35x4d.skadnetwork</string>
145 </dict>
146 <dict>
147 <key>SKAdNetworkIdentifier</key>
148 <string>e5fvkxwrpn.skadnetwork</string>
149 </dict>
150 <dict>
151 <key>SKAdNetworkIdentifier</key>
152 <string>zq492l623r.skadnetwork</string>
153 </dict>
154 <dict>
155 <key>SKAdNetworkIdentifier</key>
156 <string>3qcr597p9d.skadnetwork</string>
157 </dict>
158 </array>
159
Added requestIDFA in didFinishLaunchingWithOptions. It opens App Tracking Transparency dialog box.
1 1. GADApplicationIdentifier key with a string value of AdMob app ID.
2 2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3 3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
4- (void)requestIDFA
5{
6 if (@available(iOS 14.0, *))
7 {
8 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
9
10 // Admob Ads
11 [self loadAdmob_Ads];
12 [self loadRewardedInterstitial];
13 [self requestAppOpenAd];
14 }];
15 }
16 else
17 {
18 // Admob Ads
19 [self loadAdmob_Ads];
20 [self loadRewardedInterstitial];
21 [self requestAppOpenAd];
22 }
23}
24<key>SKAdNetworkItems</key>
25 <array>
26 <dict>
27 <key>SKAdNetworkIdentifier</key>
28 <string>cstr6suwn9.skadnetwork</string>
29 </dict>
30 <dict>
31 <key>SKAdNetworkIdentifier</key>
32 <string>4fzdc2evr5.skadnetwork</string>
33 </dict>
34 <dict>
35 <key>SKAdNetworkIdentifier</key>
36 <string>2fnua5tdw4.skadnetwork</string>
37 </dict>
38 <dict>
39 <key>SKAdNetworkIdentifier</key>
40 <string>ydx93a7ass.skadnetwork</string>
41 </dict>
42 <dict>
43 <key>SKAdNetworkIdentifier</key>
44 <string>5a6flpkh64.skadnetwork</string>
45 </dict>
46 <dict>
47 <key>SKAdNetworkIdentifier</key>
48 <string>p78axxw29g.skadnetwork</string>
49 </dict>
50 <dict>
51 <key>SKAdNetworkIdentifier</key>
52 <string>v72qych5uu.skadnetwork</string>
53 </dict>
54 <dict>
55 <key>SKAdNetworkIdentifier</key>
56 <string>c6k4g5qg8m.skadnetwork</string>
57 </dict>
58 <dict>
59 <key>SKAdNetworkIdentifier</key>
60 <string>s39g8k73mm.skadnetwork</string>
61 </dict>
62 <dict>
63 <key>SKAdNetworkIdentifier</key>
64 <string>3qy4746246.skadnetwork</string>
65 </dict>
66 <dict>
67 <key>SKAdNetworkIdentifier</key>
68 <string>3sh42y64q3.skadnetwork</string>
69 </dict>
70 <dict>
71 <key>SKAdNetworkIdentifier</key>
72 <string>f38h382jlk.skadnetwork</string>
73 </dict>
74 <dict>
75 <key>SKAdNetworkIdentifier</key>
76 <string>hs6bdukanm.skadnetwork</string>
77 </dict>
78 <dict>
79 <key>SKAdNetworkIdentifier</key>
80 <string>prcb7njmu6.skadnetwork</string>
81 </dict>
82 <dict>
83 <key>SKAdNetworkIdentifier</key>
84 <string>wzmmz9fp6w.skadnetwork</string>
85 </dict>
86 <dict>
87 <key>SKAdNetworkIdentifier</key>
88 <string>yclnxrl5pm.skadnetwork</string>
89 </dict>
90 <dict>
91 <key>SKAdNetworkIdentifier</key>
92 <string>4468km3ulz.skadnetwork</string>
93 </dict>
94 <dict>
95 <key>SKAdNetworkIdentifier</key>
96 <string>t38b2kh725.skadnetwork</string>
97 </dict>
98 <dict>
99 <key>SKAdNetworkIdentifier</key>
100 <string>7ug5zh24hu.skadnetwork</string>
101 </dict>
102 <dict>
103 <key>SKAdNetworkIdentifier</key>
104 <string>9rd848q2bz.skadnetwork</string>
105 </dict>
106 <dict>
107 <key>SKAdNetworkIdentifier</key>
108 <string>n6fk4nfna4.skadnetwork</string>
109 </dict>
110 <dict>
111 <key>SKAdNetworkIdentifier</key>
112 <string>kbd757ywx3.skadnetwork</string>
113 </dict>
114 <dict>
115 <key>SKAdNetworkIdentifier</key>
116 <string>9t245vhmpl.skadnetwork</string>
117 </dict>
118 <dict>
119 <key>SKAdNetworkIdentifier</key>
120 <string>2u9pt9hc89.skadnetwork</string>
121 </dict>
122 <dict>
123 <key>SKAdNetworkIdentifier</key>
124 <string>8s468mfl3y.skadnetwork</string>
125 </dict>
126 <dict>
127 <key>SKAdNetworkIdentifier</key>
128 <string>av6w8kgt66.skadnetwork</string>
129 </dict>
130 <dict>
131 <key>SKAdNetworkIdentifier</key>
132 <string>klf5c3l5u5.skadnetwork</string>
133 </dict>
134 <dict>
135 <key>SKAdNetworkIdentifier</key>
136 <string>ppxm28t8ap.skadnetwork</string>
137 </dict>
138 <dict>
139 <key>SKAdNetworkIdentifier</key>
140 <string>424m5254lk.skadnetwork</string>
141 </dict>
142 <dict>
143 <key>SKAdNetworkIdentifier</key>
144 <string>uw77j35x4d.skadnetwork</string>
145 </dict>
146 <dict>
147 <key>SKAdNetworkIdentifier</key>
148 <string>e5fvkxwrpn.skadnetwork</string>
149 </dict>
150 <dict>
151 <key>SKAdNetworkIdentifier</key>
152 <string>zq492l623r.skadnetwork</string>
153 </dict>
154 <dict>
155 <key>SKAdNetworkIdentifier</key>
156 <string>3qcr597p9d.skadnetwork</string>
157 </dict>
158 </array>
159- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
160
161 [[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
162 [self requestIDFA];
163.
164.
165.
166}
167
requestIDFA function:
1 1. GADApplicationIdentifier key with a string value of AdMob app ID.
2 2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3 3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
4- (void)requestIDFA
5{
6 if (@available(iOS 14.0, *))
7 {
8 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
9
10 // Admob Ads
11 [self loadAdmob_Ads];
12 [self loadRewardedInterstitial];
13 [self requestAppOpenAd];
14 }];
15 }
16 else
17 {
18 // Admob Ads
19 [self loadAdmob_Ads];
20 [self loadRewardedInterstitial];
21 [self requestAppOpenAd];
22 }
23}
24<key>SKAdNetworkItems</key>
25 <array>
26 <dict>
27 <key>SKAdNetworkIdentifier</key>
28 <string>cstr6suwn9.skadnetwork</string>
29 </dict>
30 <dict>
31 <key>SKAdNetworkIdentifier</key>
32 <string>4fzdc2evr5.skadnetwork</string>
33 </dict>
34 <dict>
35 <key>SKAdNetworkIdentifier</key>
36 <string>2fnua5tdw4.skadnetwork</string>
37 </dict>
38 <dict>
39 <key>SKAdNetworkIdentifier</key>
40 <string>ydx93a7ass.skadnetwork</string>
41 </dict>
42 <dict>
43 <key>SKAdNetworkIdentifier</key>
44 <string>5a6flpkh64.skadnetwork</string>
45 </dict>
46 <dict>
47 <key>SKAdNetworkIdentifier</key>
48 <string>p78axxw29g.skadnetwork</string>
49 </dict>
50 <dict>
51 <key>SKAdNetworkIdentifier</key>
52 <string>v72qych5uu.skadnetwork</string>
53 </dict>
54 <dict>
55 <key>SKAdNetworkIdentifier</key>
56 <string>c6k4g5qg8m.skadnetwork</string>
57 </dict>
58 <dict>
59 <key>SKAdNetworkIdentifier</key>
60 <string>s39g8k73mm.skadnetwork</string>
61 </dict>
62 <dict>
63 <key>SKAdNetworkIdentifier</key>
64 <string>3qy4746246.skadnetwork</string>
65 </dict>
66 <dict>
67 <key>SKAdNetworkIdentifier</key>
68 <string>3sh42y64q3.skadnetwork</string>
69 </dict>
70 <dict>
71 <key>SKAdNetworkIdentifier</key>
72 <string>f38h382jlk.skadnetwork</string>
73 </dict>
74 <dict>
75 <key>SKAdNetworkIdentifier</key>
76 <string>hs6bdukanm.skadnetwork</string>
77 </dict>
78 <dict>
79 <key>SKAdNetworkIdentifier</key>
80 <string>prcb7njmu6.skadnetwork</string>
81 </dict>
82 <dict>
83 <key>SKAdNetworkIdentifier</key>
84 <string>wzmmz9fp6w.skadnetwork</string>
85 </dict>
86 <dict>
87 <key>SKAdNetworkIdentifier</key>
88 <string>yclnxrl5pm.skadnetwork</string>
89 </dict>
90 <dict>
91 <key>SKAdNetworkIdentifier</key>
92 <string>4468km3ulz.skadnetwork</string>
93 </dict>
94 <dict>
95 <key>SKAdNetworkIdentifier</key>
96 <string>t38b2kh725.skadnetwork</string>
97 </dict>
98 <dict>
99 <key>SKAdNetworkIdentifier</key>
100 <string>7ug5zh24hu.skadnetwork</string>
101 </dict>
102 <dict>
103 <key>SKAdNetworkIdentifier</key>
104 <string>9rd848q2bz.skadnetwork</string>
105 </dict>
106 <dict>
107 <key>SKAdNetworkIdentifier</key>
108 <string>n6fk4nfna4.skadnetwork</string>
109 </dict>
110 <dict>
111 <key>SKAdNetworkIdentifier</key>
112 <string>kbd757ywx3.skadnetwork</string>
113 </dict>
114 <dict>
115 <key>SKAdNetworkIdentifier</key>
116 <string>9t245vhmpl.skadnetwork</string>
117 </dict>
118 <dict>
119 <key>SKAdNetworkIdentifier</key>
120 <string>2u9pt9hc89.skadnetwork</string>
121 </dict>
122 <dict>
123 <key>SKAdNetworkIdentifier</key>
124 <string>8s468mfl3y.skadnetwork</string>
125 </dict>
126 <dict>
127 <key>SKAdNetworkIdentifier</key>
128 <string>av6w8kgt66.skadnetwork</string>
129 </dict>
130 <dict>
131 <key>SKAdNetworkIdentifier</key>
132 <string>klf5c3l5u5.skadnetwork</string>
133 </dict>
134 <dict>
135 <key>SKAdNetworkIdentifier</key>
136 <string>ppxm28t8ap.skadnetwork</string>
137 </dict>
138 <dict>
139 <key>SKAdNetworkIdentifier</key>
140 <string>424m5254lk.skadnetwork</string>
141 </dict>
142 <dict>
143 <key>SKAdNetworkIdentifier</key>
144 <string>uw77j35x4d.skadnetwork</string>
145 </dict>
146 <dict>
147 <key>SKAdNetworkIdentifier</key>
148 <string>e5fvkxwrpn.skadnetwork</string>
149 </dict>
150 <dict>
151 <key>SKAdNetworkIdentifier</key>
152 <string>zq492l623r.skadnetwork</string>
153 </dict>
154 <dict>
155 <key>SKAdNetworkIdentifier</key>
156 <string>3qcr597p9d.skadnetwork</string>
157 </dict>
158 </array>
159- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
160
161 [[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
162 [self requestIDFA];
163.
164.
165.
166}
167- (void)requestIDFA
168{
169 if (@available(iOS 14.0, *))
170 {
171 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
172
173 // Admob Ads
174 [self requestAppOpenAd];
175 [self loadAdmob_Ads];
176 [self loadRewardedInterstitial];
177 }];
178 }
179 else
180 {
181 // Admob Ads
182 [self requestAppOpenAd];
183 [self loadAdmob_Ads];
184 [self loadRewardedInterstitial];
185 }
186}
187
Added AppTrackingTransparency.framework to Xcode.
In info.plist added NSUserTrackingUsageDescription
1 1. GADApplicationIdentifier key with a string value of AdMob app ID.
2 2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3 3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
4- (void)requestIDFA
5{
6 if (@available(iOS 14.0, *))
7 {
8 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
9
10 // Admob Ads
11 [self loadAdmob_Ads];
12 [self loadRewardedInterstitial];
13 [self requestAppOpenAd];
14 }];
15 }
16 else
17 {
18 // Admob Ads
19 [self loadAdmob_Ads];
20 [self loadRewardedInterstitial];
21 [self requestAppOpenAd];
22 }
23}
24<key>SKAdNetworkItems</key>
25 <array>
26 <dict>
27 <key>SKAdNetworkIdentifier</key>
28 <string>cstr6suwn9.skadnetwork</string>
29 </dict>
30 <dict>
31 <key>SKAdNetworkIdentifier</key>
32 <string>4fzdc2evr5.skadnetwork</string>
33 </dict>
34 <dict>
35 <key>SKAdNetworkIdentifier</key>
36 <string>2fnua5tdw4.skadnetwork</string>
37 </dict>
38 <dict>
39 <key>SKAdNetworkIdentifier</key>
40 <string>ydx93a7ass.skadnetwork</string>
41 </dict>
42 <dict>
43 <key>SKAdNetworkIdentifier</key>
44 <string>5a6flpkh64.skadnetwork</string>
45 </dict>
46 <dict>
47 <key>SKAdNetworkIdentifier</key>
48 <string>p78axxw29g.skadnetwork</string>
49 </dict>
50 <dict>
51 <key>SKAdNetworkIdentifier</key>
52 <string>v72qych5uu.skadnetwork</string>
53 </dict>
54 <dict>
55 <key>SKAdNetworkIdentifier</key>
56 <string>c6k4g5qg8m.skadnetwork</string>
57 </dict>
58 <dict>
59 <key>SKAdNetworkIdentifier</key>
60 <string>s39g8k73mm.skadnetwork</string>
61 </dict>
62 <dict>
63 <key>SKAdNetworkIdentifier</key>
64 <string>3qy4746246.skadnetwork</string>
65 </dict>
66 <dict>
67 <key>SKAdNetworkIdentifier</key>
68 <string>3sh42y64q3.skadnetwork</string>
69 </dict>
70 <dict>
71 <key>SKAdNetworkIdentifier</key>
72 <string>f38h382jlk.skadnetwork</string>
73 </dict>
74 <dict>
75 <key>SKAdNetworkIdentifier</key>
76 <string>hs6bdukanm.skadnetwork</string>
77 </dict>
78 <dict>
79 <key>SKAdNetworkIdentifier</key>
80 <string>prcb7njmu6.skadnetwork</string>
81 </dict>
82 <dict>
83 <key>SKAdNetworkIdentifier</key>
84 <string>wzmmz9fp6w.skadnetwork</string>
85 </dict>
86 <dict>
87 <key>SKAdNetworkIdentifier</key>
88 <string>yclnxrl5pm.skadnetwork</string>
89 </dict>
90 <dict>
91 <key>SKAdNetworkIdentifier</key>
92 <string>4468km3ulz.skadnetwork</string>
93 </dict>
94 <dict>
95 <key>SKAdNetworkIdentifier</key>
96 <string>t38b2kh725.skadnetwork</string>
97 </dict>
98 <dict>
99 <key>SKAdNetworkIdentifier</key>
100 <string>7ug5zh24hu.skadnetwork</string>
101 </dict>
102 <dict>
103 <key>SKAdNetworkIdentifier</key>
104 <string>9rd848q2bz.skadnetwork</string>
105 </dict>
106 <dict>
107 <key>SKAdNetworkIdentifier</key>
108 <string>n6fk4nfna4.skadnetwork</string>
109 </dict>
110 <dict>
111 <key>SKAdNetworkIdentifier</key>
112 <string>kbd757ywx3.skadnetwork</string>
113 </dict>
114 <dict>
115 <key>SKAdNetworkIdentifier</key>
116 <string>9t245vhmpl.skadnetwork</string>
117 </dict>
118 <dict>
119 <key>SKAdNetworkIdentifier</key>
120 <string>2u9pt9hc89.skadnetwork</string>
121 </dict>
122 <dict>
123 <key>SKAdNetworkIdentifier</key>
124 <string>8s468mfl3y.skadnetwork</string>
125 </dict>
126 <dict>
127 <key>SKAdNetworkIdentifier</key>
128 <string>av6w8kgt66.skadnetwork</string>
129 </dict>
130 <dict>
131 <key>SKAdNetworkIdentifier</key>
132 <string>klf5c3l5u5.skadnetwork</string>
133 </dict>
134 <dict>
135 <key>SKAdNetworkIdentifier</key>
136 <string>ppxm28t8ap.skadnetwork</string>
137 </dict>
138 <dict>
139 <key>SKAdNetworkIdentifier</key>
140 <string>424m5254lk.skadnetwork</string>
141 </dict>
142 <dict>
143 <key>SKAdNetworkIdentifier</key>
144 <string>uw77j35x4d.skadnetwork</string>
145 </dict>
146 <dict>
147 <key>SKAdNetworkIdentifier</key>
148 <string>e5fvkxwrpn.skadnetwork</string>
149 </dict>
150 <dict>
151 <key>SKAdNetworkIdentifier</key>
152 <string>zq492l623r.skadnetwork</string>
153 </dict>
154 <dict>
155 <key>SKAdNetworkIdentifier</key>
156 <string>3qcr597p9d.skadnetwork</string>
157 </dict>
158 </array>
159- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
160
161 [[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
162 [self requestIDFA];
163.
164.
165.
166}
167- (void)requestIDFA
168{
169 if (@available(iOS 14.0, *))
170 {
171 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
172
173 // Admob Ads
174 [self requestAppOpenAd];
175 [self loadAdmob_Ads];
176 [self loadRewardedInterstitial];
177 }];
178 }
179 else
180 {
181 // Admob Ads
182 [self requestAppOpenAd];
183 [self loadAdmob_Ads];
184 [self loadRewardedInterstitial];
185 }
186}
187<key>NSUserTrackingUsageDescription</key>
188<string>This identifier will be used to deliver personalized ads to you.</string>
189
Admob ads related functions:
1 1. GADApplicationIdentifier key with a string value of AdMob app ID.
2 2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3 3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
4- (void)requestIDFA
5{
6 if (@available(iOS 14.0, *))
7 {
8 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
9
10 // Admob Ads
11 [self loadAdmob_Ads];
12 [self loadRewardedInterstitial];
13 [self requestAppOpenAd];
14 }];
15 }
16 else
17 {
18 // Admob Ads
19 [self loadAdmob_Ads];
20 [self loadRewardedInterstitial];
21 [self requestAppOpenAd];
22 }
23}
24<key>SKAdNetworkItems</key>
25 <array>
26 <dict>
27 <key>SKAdNetworkIdentifier</key>
28 <string>cstr6suwn9.skadnetwork</string>
29 </dict>
30 <dict>
31 <key>SKAdNetworkIdentifier</key>
32 <string>4fzdc2evr5.skadnetwork</string>
33 </dict>
34 <dict>
35 <key>SKAdNetworkIdentifier</key>
36 <string>2fnua5tdw4.skadnetwork</string>
37 </dict>
38 <dict>
39 <key>SKAdNetworkIdentifier</key>
40 <string>ydx93a7ass.skadnetwork</string>
41 </dict>
42 <dict>
43 <key>SKAdNetworkIdentifier</key>
44 <string>5a6flpkh64.skadnetwork</string>
45 </dict>
46 <dict>
47 <key>SKAdNetworkIdentifier</key>
48 <string>p78axxw29g.skadnetwork</string>
49 </dict>
50 <dict>
51 <key>SKAdNetworkIdentifier</key>
52 <string>v72qych5uu.skadnetwork</string>
53 </dict>
54 <dict>
55 <key>SKAdNetworkIdentifier</key>
56 <string>c6k4g5qg8m.skadnetwork</string>
57 </dict>
58 <dict>
59 <key>SKAdNetworkIdentifier</key>
60 <string>s39g8k73mm.skadnetwork</string>
61 </dict>
62 <dict>
63 <key>SKAdNetworkIdentifier</key>
64 <string>3qy4746246.skadnetwork</string>
65 </dict>
66 <dict>
67 <key>SKAdNetworkIdentifier</key>
68 <string>3sh42y64q3.skadnetwork</string>
69 </dict>
70 <dict>
71 <key>SKAdNetworkIdentifier</key>
72 <string>f38h382jlk.skadnetwork</string>
73 </dict>
74 <dict>
75 <key>SKAdNetworkIdentifier</key>
76 <string>hs6bdukanm.skadnetwork</string>
77 </dict>
78 <dict>
79 <key>SKAdNetworkIdentifier</key>
80 <string>prcb7njmu6.skadnetwork</string>
81 </dict>
82 <dict>
83 <key>SKAdNetworkIdentifier</key>
84 <string>wzmmz9fp6w.skadnetwork</string>
85 </dict>
86 <dict>
87 <key>SKAdNetworkIdentifier</key>
88 <string>yclnxrl5pm.skadnetwork</string>
89 </dict>
90 <dict>
91 <key>SKAdNetworkIdentifier</key>
92 <string>4468km3ulz.skadnetwork</string>
93 </dict>
94 <dict>
95 <key>SKAdNetworkIdentifier</key>
96 <string>t38b2kh725.skadnetwork</string>
97 </dict>
98 <dict>
99 <key>SKAdNetworkIdentifier</key>
100 <string>7ug5zh24hu.skadnetwork</string>
101 </dict>
102 <dict>
103 <key>SKAdNetworkIdentifier</key>
104 <string>9rd848q2bz.skadnetwork</string>
105 </dict>
106 <dict>
107 <key>SKAdNetworkIdentifier</key>
108 <string>n6fk4nfna4.skadnetwork</string>
109 </dict>
110 <dict>
111 <key>SKAdNetworkIdentifier</key>
112 <string>kbd757ywx3.skadnetwork</string>
113 </dict>
114 <dict>
115 <key>SKAdNetworkIdentifier</key>
116 <string>9t245vhmpl.skadnetwork</string>
117 </dict>
118 <dict>
119 <key>SKAdNetworkIdentifier</key>
120 <string>2u9pt9hc89.skadnetwork</string>
121 </dict>
122 <dict>
123 <key>SKAdNetworkIdentifier</key>
124 <string>8s468mfl3y.skadnetwork</string>
125 </dict>
126 <dict>
127 <key>SKAdNetworkIdentifier</key>
128 <string>av6w8kgt66.skadnetwork</string>
129 </dict>
130 <dict>
131 <key>SKAdNetworkIdentifier</key>
132 <string>klf5c3l5u5.skadnetwork</string>
133 </dict>
134 <dict>
135 <key>SKAdNetworkIdentifier</key>
136 <string>ppxm28t8ap.skadnetwork</string>
137 </dict>
138 <dict>
139 <key>SKAdNetworkIdentifier</key>
140 <string>424m5254lk.skadnetwork</string>
141 </dict>
142 <dict>
143 <key>SKAdNetworkIdentifier</key>
144 <string>uw77j35x4d.skadnetwork</string>
145 </dict>
146 <dict>
147 <key>SKAdNetworkIdentifier</key>
148 <string>e5fvkxwrpn.skadnetwork</string>
149 </dict>
150 <dict>
151 <key>SKAdNetworkIdentifier</key>
152 <string>zq492l623r.skadnetwork</string>
153 </dict>
154 <dict>
155 <key>SKAdNetworkIdentifier</key>
156 <string>3qcr597p9d.skadnetwork</string>
157 </dict>
158 </array>
159- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
160
161 [[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
162 [self requestIDFA];
163.
164.
165.
166}
167- (void)requestIDFA
168{
169 if (@available(iOS 14.0, *))
170 {
171 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
172
173 // Admob Ads
174 [self requestAppOpenAd];
175 [self loadAdmob_Ads];
176 [self loadRewardedInterstitial];
177 }];
178 }
179 else
180 {
181 // Admob Ads
182 [self requestAppOpenAd];
183 [self loadAdmob_Ads];
184 [self loadRewardedInterstitial];
185 }
186}
187<key>NSUserTrackingUsageDescription</key>
188<string>This identifier will be used to deliver personalized ads to you.</string>
189- (void)requestAppOpenAd {
190 self.appOpenAd = nil;
191 [GADAppOpenAd loadWithAdUnitID:ADMOB_APP_OPEN_ID
192 request:[GADRequest request]
193 orientation:UIInterfaceOrientationPortrait
194 completionHandler:^(GADAppOpenAd *_Nullable appOpenAd, NSError *_Nullable error) {
195 if (error) {
196 NSLog(@"Failed to load app open ad: %@", error);
197 return;
198 }
199 self.appOpenAd = appOpenAd;
200 self.appOpenAd.fullScreenContentDelegate = self;
201
202 }];
203}
204
205- (void)tryToPresentAd
206{
207 if (self.appOpenAd) {
208 UIViewController *rootController = self.window.rootViewController;
209 [self.appOpenAd presentFromRootViewController:rootController];
210 } else {
211 // If you don't have an ad ready, request one.
212 [self requestAppOpenAd];
213 }
214}
215
216- (void)applicationDidBecomeActive:(UIApplication *)application {
217 [self tryToPresentAd];
218}
219
220-(void)loadAdmob_Ads
221{
222 GADRequest *request = [GADRequest request];
223
224 [GADInterstitialAd loadWithAdUnitID:ADMOB_FULL_SCREEM
225 request:request
226 completionHandler:^(GADInterstitialAd *ad, NSError *error)
227 {
228 if (error)
229 {
230 NSLog(@"\nAdmob Failed to load interstitial ad with error: %@", [error localizedDescription]);
231 return;
232 }
233 self.interstitial = ad;
234 self.interstitial.fullScreenContentDelegate = self;
235 }];
236}
237
238-(void)showAdmobAdsFullScreen
239{
240 if (self.interstitial) {
241 [self.interstitial presentFromRootViewController:self.viewController];
242 }
243}
244
245-(void)loadRewardedInterstitial
246{
247 [GADRewardedInterstitialAd
248 loadWithAdUnitID:ADMOB_REWARDED_INTERSTITIAL
249 request:[GADRequest request]
250 completionHandler:^(
251 GADRewardedInterstitialAd *_Nullable rewardedInterstitialAd,
252 NSError *_Nullable error) {
253 if (!error) {
254 self.rewardedInterstitialAd = rewardedInterstitialAd;
255 self.rewardedInterstitialAd.fullScreenContentDelegate = self;
256 }
257 }];
258}
259
260-(void)playRewardedInterstitial
261{
262 [self.rewardedInterstitialAd presentFromRootViewController:self.viewController
263 userDidEarnRewardHandler:^{
264
265 [self rewardInterstitialDoneRewardUser];
266
267 [self loadRewardedInterstitial];
268 }];
269}
270
Google Official Documentation:
SKAdNetworkItems iOS 14 Updates : https://developers.google.com/admob/ios/ios14
GADInterstitialAd : https://developers.google.com/admob/ios/interstitial
GADRewardedInterstitialAd : https://developers.google.com/admob/ios/rewarded-interstitial
GADRewardedAd : https://developers.google.com/admob/ios/rewarded-ads
GADAppOpenAd : https://developers.google.com/admob/ios/app-open-ads
Adaptive Banner ( GADBannerView ) : https://developers.google.com/admob/ios/banner/adaptive
NSAppTransportSecurity : https://developers.google.com/admob/ios/app-transport-security
Community Discussions contain sources that include Stack Exchange Network
QUESTION
Error APNS device token not set before retrieving FCM Token for Sender ID
Asked 2022-Mar-01 at 17:08I am receiving messages from firebase for notifications with APNs. In firebase, I have the certificate of APNs key, with the same id in the Xcode project in Firebase that is extracted from Apple Developer.
But I don't know why this could be happening and I get this error and it is registering two tokens in the Messaging extension:
1extension AppDelegate : MessagingDelegate {
2 func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {}}
3
APNS device token not set before retrieving FCM Token for Sender ID '########'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set.
Added what I have in the AppDelegate
1extension AppDelegate : MessagingDelegate {
2 func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {}}
3import Firebase
4import MasivPushIosSdk
5
6@UIApplicationMain
7class AppDelegate: UIResponder, UIApplicationDelegate{
8
9 var firebaseToken: String = ""
10
11 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
12
13 FirebaseApp.configure()
14 self.registerForFirebaseNotification(application: application)
15 Messaging.messaging().delegate = self
16 return true
17 }
18
19 func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
20 Messaging.messaging().apnsToken = deviceToken
21 }
22
23 func registerForFirebaseNotification(application: UIApplication) {
24 if #available(iOS 10.0, *) {
25 // For iOS 10 display notification (sent via APNS)
26 UNUserNotificationCenter.current().delegate = self
27
28 let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
29 UNUserNotificationCenter.current().requestAuthorization(
30 options: authOptions,
31 completionHandler: {_, _ in })
32 } else {
33 let settings: UIUserNotificationSettings =
34