This is related to Messaging

Explore Related Topics

Popular New Releases in Messaging

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

Popular Libraries in Messaging

dubbo

by apache doticonjavadoticon

star image 37142 doticonApache-2.0

Apache Dubbo is a high-performance, java based, open source RPC framework.

uni-app

by dcloudio doticonjavascriptdoticon

star image 36431 doticonApache-2.0

uni-app 是使用 Vue 语法开发小程序、H5、App的统一框架

taro

by NervJS doticontypescriptdoticon

star image 30875 doticonMIT

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/

EventBus

by greenrobot doticonjavadoticon

star image 23725 doticonApache-2.0

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.

ItChat

by littlecodersh doticonpythondoticon

star image 21699 doticonNOASSERTION

A complete and graceful API for Wechat. 微信个人号接口、微信机器人及命令行微信,三十行即可自定义个人号机器人。

kafka

by apache doticonjavadoticon

star image 21667 doticonApache-2.0

Mirror of Apache Kafka

celery

by celery doticonpythondoticon

star image 19164 doticonNOASSERTION

Distributed Task Queue (development branch)

python-telegram-bot

by python-telegram-bot doticonpythondoticon

star image 18256 doticonNOASSERTION

We have made you a wrapper you can't refuse

PHPMailer

by PHPMailer doticonphpdoticon

star image 18018 doticonLGPL-2.1

The classic email sending library for PHP

Trending New libraries in Messaging

data-science-interviews

by alexeygrigorev doticonhtmldoticon

star image 5065 doticonCC-BY-4.0

Data science interview questions and answers

venom

by orkestral doticonjavascriptdoticon

star image 3775 doticonApache-2.0

Venom is the most complete javascript library for Whatsapp, 100% Open Source.

fosscord

by fosscord doticonjavascriptdoticon

star image 3576 doticonAGPL-3.0

Fosscord is a free open source selfhostable discord compatible communication platform

LogiKM

by didi doticonjavadoticon

star image 3451 doticonApache-2.0

一站式Apache Kafka集群指标监控与运维管控平台

redpanda

by vectorizedio doticonc++doticon

star image 3320 doticon

Redpanda is the real-time engine for modern apps. Kafka API Compatible; 10x faster 🚀 See more at redpanda.com

CrewLink

by ottomated doticontypescriptdoticon

star image 3159 doticonGPL-3.0

Free, open, Among Us Proximity Chat

tmpmail

by sdushantha doticonshelldoticon

star image 2789 doticonMIT

A temporary email right from your terminal written in POSIX sh

Logi-KafkaManager

by didi doticonjavadoticon

star image 2639 doticonApache-2.0

一站式Apache Kafka集群指标监控与运维管控平台

script-commands

by raycast doticonshelldoticon

star image 2351 doticonMIT

Script Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.

Top Authors in Messaging

1

getweapp

86 Libraries

star icon1233

2

apache

65 Libraries

star icon121059

3

TwilioDevEd

40 Libraries

star icon494

4

laravel-notification-channels

34 Libraries

star icon2254

5

GetStream

32 Libraries

star icon3521

6

microsoft

27 Libraries

star icon2625

7

confluentinc

27 Libraries

star icon16029

8

IBM

26 Libraries

star icon1012

9

lensesio

26 Libraries

star icon2587

10

wechaty

26 Libraries

star icon14368

1

86 Libraries

star icon1233

2

65 Libraries

star icon121059

3

40 Libraries

star icon494

5

32 Libraries

star icon3521

6

27 Libraries

star icon2625

7

27 Libraries

star icon16029

8

26 Libraries

star icon1012

9

26 Libraries

star icon2587

10

26 Libraries

star icon14368

Trending Kits in Messaging

Two-factor authentication (2FA) is a multifactor security process where users must authenticate their identity with two different means. This ensures better protection of secured assets and information.

Traditional username and password combinations are prone to hacking and getting hacked has been on the rise. Implementing 2FA authentication will prevent hackers from accessing your accounts even if your password is stolen. 2FA is a recommended practice for securing all your online accounts and devices to protect sensitive information losses.

You will need a different set of components with features ranging from creating the secret codes, accessing and authenticating.

OTP:

Time-based One-Time Password involves generating a one-time password from a shared secret key and the current timestamp using cryptographic algorithms. These libraries will help you generate secrete one-time passwords

SMS

Typically the OTP codes are sent to the user's mobile phone using SMS. This also helps to validate the user's mobile number correctness. The user can then enter the secret code into the application to complete the multifactor authentication. The below libraries will help in sending SMS from your application.

Email

The unique generated one-time password is sent via email to the user. The user uses the code from the email and enters the code into the application to confirm the authentication.

Biometric Authentication

Using Biometrics for authentication has been made easy with mobile devices. Biometrics can include different choices, such as using fingerprints, voice, and face as the secondary authentication mechanism.

Push Notifications

Typically, push notifications are sent to your mobile app to authorize login requests. It will include the details of the access device details and once authorized, the login to the application is allowed. Below libraries help in implementing the push notification-based authorization.

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,

Here are the top Python Email Libraries you will need to get built-in support to send emails using the SMTP protocol. The smtplib module will define an SMTP client session object which we can use for sending email to any machine connected to the internet with an ESMTP or SMTP listener daemon.  


We can use Python for sending an email in many ways, like an email with an attachment, an HTML/Markdown-formatted email message, or plain text. Many third-party libraries are available in the market, like EmailReplyParser for parsing the response from email threads, EmailMessage module in Python’s Standard Library, Mailgun-py, which is an official and actively maintained library, and Flanker which is a parsing and validation library.  


We have handpicked the top 15 Python Email Libraries in 2023 which fulfill all the developer requirements: 

GHunt: 

  • Is an offensive Google Framework that is designed to evolve effectively.  
  • Is fully asynchronous and uses CLI & modules.  
  • Will automatically use venvs to avoid dependency conflicts with other projects.  

mailinabox: 

  • Helps us in taking back control of our email by defining an easy-to-deploy, one-click SMTP+everything else server: a mail server in a box. 
  • Promotes innovation, privacy, and decentralization on the web. 
  • Has auditable, idempotent, and automated configuration.  

Mailpile: 

  • Is a fast web-mail client, modern, with user-friendly privacy and encryption features.  
  • Places emphasize providing an elegant user interface and a clean and pleasant user experience.  
  • Allows email to be organized with tags and lets us automatically configure tag incoming email depending on Bayesian classifiers or static rules.  

theHarvester: 

  • Is a simple yet powerful tool designed for use during the reconnaissance stage of a penetrated or a red team assessment test.  
  • Performs Open Source Intelligence (OSINT) by gathering help in determining a domain’s external threat landscape. 
  • Gathers emails, subdomains, URLs, names, and IPs with the help of multiple public resources. 

pyWhat: 

  • Will easily let you identify IP addresses, emails, and more. 
  • Helps in filtering outputs, exporting, and sorting according to your requirements. 
  • Supports filters like bug bounties and many more. 

sync-engine: 

  • Offers a RESTful API on top of a powerful email sync platform to make it easier to build apps on top of the email.  
  • The API service will provide a REST API to help interact with your data.  
  • The sync engine will automatically begin synchronizing your account with your current provider. 

yagmail: 

  • Is an SMTP/GMAIL client which aims to make sending emails the simplest and easiest task. 
  • With yagmail, sending emails to many people by offering a list of email strings rather than mentioning a single string is possible. 
  • Is a wrapper library on top of smtplib that is a standard library to send emails using Python.  

mailin: 

  • Is an SMTP server that listens to emails, parses them, and posts them in json format to the URL you choose.  
  • Checks incoming email’s spf, spam score, and dkim to tell you the language in which it is written.  
  • Can be used as a standalone application embedded inside a node application or directly from the command line. 

offlineimap: 

  • Is software that helps download your email mailbox or mailboxes as local Maildirs.  
  • OfflineIMAP will synchronize both sides using IMAP.  
  • Allows you to read your email offline without requiring your mail reader to support your IMAP operations. 

gmail: 

  • Is a Pythonic interface for Google’s Gmail with all the necessary tools.  
  • Will search, archive, delete, read, and send multipart emails, manage labels, and mark as read/unread emails. 
  • Connects with live Gmail for accessing real-time data. 

flanker: 

  • Is an open source parsing library in Python which contains an address and a MIME parsing library.  
  • Both can parse addresses, validate them, and convert headers to Unicode, which detects and preserves encodings when possible.  
  • Stores the message in a single string, tracks changes, and returns unchanged parts during serialization. 

inbox.py: 

  • Is an asynchronous simplest SMTP server.  
  • Can handle one instance of over one thousand emails per second.  
  • Is a library for managing email inboxes that provides an API for creating, deleting, reading, and retrieving emails. 

django-anymail: 

  • Let's send and receive an email in Django with your choice of transactional Email Service Provider (ESPs).  
  • Includes integration to each ESP’s sending APIs into Django’s built-in email package, simplified inline images from HTML email, and ‘Batch Transactional’ sends with your ESP’s merging and templating features.  
  • Maintains compatibility with all Django versions and is extensively tested on all Python versions which Django supports.  

python-o365: 

  • Aims in making interact with Office 365 and Microsoft Graph in a Pythonic and easy way. 
  • Helps with access to Calendar, OneDrive, Email, and Contacts.  
  • Provides automatic handling between local and server datetimes. 

SimplyEmail: 

  • Is an email recon that is easy and quick using the framework built on.  
  • Uses built-in Parsers for the rawest results.  
  • Multiprocessing Queue for modules and Results Queue for easy Email data handling. 

Most Python Discord API libraries offer various features, making it easier to develop Discord bots and interact with the Discord API. Most Python Discord API libraries offer an effortless way of creating and managing bots on the Discord Platform. These libraries often offer functionality for handling events like a user joining a server, a reaction added to a message, or a message received.  


These libraries offer effortless ways to handle commands from the Discord server users. It can handle audio and voice functionalities, like streaming video, joining voice channels, and more. These support Discord’s new slash commands that offer an easy-to-use interface for users to interact with bots. It has a built-in caching mechanism for reducing the number of API requests to Discord and improving its performance. It offers methods for easily making requests to the Discord API and handling responses. It supports Discord webhooks by letting bots send messages and interact with Discord outside a server.  


Here is the list of the top 8 Python Discord API libraries that are handpicked to help developers: 

discord.py: 

  • Is an easy-to-use, asynchronous-ready, modern, and feature-rich API wrapper for Discord written in Python.  
  • Offers a simple and intuitive API to build Discord bots, making it accessible for developers of all skill sets.  
  • Has robust support for audio and voice, like streaming audio, joining voice channels, and many more.  

modmail: 

  • Is a Python library to build a moderation system within Discord servers. 
  • Allows users to contact server administration and moderators privately without having to share their messages publicly in a channel.  
  • Tracks user data like their conversation and messages history, making it easier for moderators to handle ongoing issues. 

nextcord: 

  • Is a Python library to build Discord bots that are forked from the original discord.py.  
  • Offers similar functionality as discord.py with certain improvements and changes.  
  • Has support for Discord’s new slash commands that offers an easy-to-use for users to interact with bots. 

hikari: 

  • Is a Python library to build Discord bots that aim to offer a modern and efficient API compared to other Python Discord libraries. 
  • Is designed with modern Python features like type hints and async/await. 
  • Is optimized for performance and uses asyncio for handling requests and events. 

interactions.py: 

  • Is a Python library that is a highly extensible, complete feature, and easy-to-use bot framework for Discord.  
  • Our HTTP client implements preemptive rate limit avoidance, so your bot is guaranteed never to hit HTTP 429.  
  • Each HTTP request and Gateway event made is cached if needed, so you never have to save information yourself. 

disnake: 

  • Is a fast, efficient, and modern Python library to build Discord bots, a fork of the discord.py library with many improvements.  
  • Is optimized for performance and uses asyncio to handle requests and events, making it one of the fastest Discord libraries.  
  • Discord’s components are supported in disnake, allowing more engaging and interactive bot experiences. 

jishaku: 

  • Is a debugging and testing extension for Discord.py, a popular Python library for creating Discord bots. 
  • Offers various utilities for debugging and testing Discord.py applications, like an interactive shell for running code snippets and functionality and commands for inspecting the current state of the server and bot.  
  • Advanced error handling and reports with detailed information about the cause of errors and how to fix them. 

Raid-Toolbox: 

  • A Python library is a big toolkit of raiding, token management, and spamming tools for Discord.  
  • Includes custom themes or skins, token checker, message spammer, and mass mentioner. 
  • Also includes DM spammer, Group DM spammer, image spammer, embed spammer, and Ascii spammer. 

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.

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.

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.

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.

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.


Streaming is the continuous transmission of data from a server to a client. These streaming data can be processed, stored, analyzed, and acted upon in real-time using stream processing technology. The common applications of streaming data process include IoT sensors, server logs etc. to find bugs/anomalies in real-time.


Anomaly Detection is the process of identification of suspicious/rare events by monitoring their significant difference from the standard behavioral pattern of data. In this solution, we identify anomaly in real-time streaming data by Machine Learning techniques.


The Streaming architecture and processing is handled by Kafka and Zookeeper.


A representative output of the execution of the Producer and consumer parts of files is provided below. The left pane is a command prompt which runs the producer file (which sends the data stream) and the right pane is a command prompt which runs the consumer file (which receives the data stream).



Libraries used in this solution


Streaming


Streaming libraries are essential for transmission of data in real-time.

Machine Learning


Machine learning libraries and frameworks here are helpful in providing state-of-the-art solutions using Machine learning.

Support


For any support, you can reach us at OpenWeaver Community Support

kandi 1-Click Install

Here are some of the famous Java ChatGpt Libraries. Java ChatGpt Libraries use cases include Online customer service, Educational use, Mobile applications, Automated marketing. 


Java chatbot libraries are libraries of pre-written code that allow developers to create virtual chatbot applications for a variety of purposes. These libraries are designed to allow developers to quickly and easily create chatbots that can respond to user input in natural language. They can be used to create chatbots for customer service, marketing, entertainment, and more. 


Let us have a look at some of the famous Java ChatGpt Libraries in detail below. 

im-server

  • Can handle large numbers of users and messages without any performance degradation.
  • Platform-independent, meaning it can be used on any operating system that supports Java.
  • Provides secure communication by using SSL encryption for all data transmission.

Smack

  • Provides a Java-based XMPP protocol stack.
  • Supports a wide range of protocols related to chat.
  • Simple and extensible architecture makes it easy to customize and extend for custom needs.

mqtt-client

  • Open standard that is supported by a wide range of different vendors.
  • Provides a secure way to communicate, with data encrypted in transit and authentication methods.
  • Requires minimal bandwidth and resources for communication, making it idea for applications with limited resources.

InChat

  • Built from the ground up using JavaFX.
  • Supports multiple chatrooms, allowing users to create their own private or public chatrooms.
  • Provides a customizable interface, allowing users to change the look and feel of the interface.

chatgpt-java

  • Supports both text and voice-based interactions.
  • Supports a variety of text-based user interfaces, such as buttons, menus, and text prompts.
  • Built-in natural language understanding (NLU) engine that can easily be trained to recognize intents and entities.

PircBot

  • Sophisticated event-driven architecture.
  • Support for SSL connections.
  • Supports proxies.

SGPT

  • Provides advanced features such as presence, message routing, and message delivery.
  • Provides advanced analytics and monitoring capabilities.
  • Built-in support for social networks, allowing for integration with popular services

Here are some of the famous Nodejs WhatsApp API Libraries. These Libraries are used for Creating interactive bots, Creating chatbots, Sending automated messages, and Integrating with other applications.


Node.js WhatsApp API Libraries are libraries that allow developers to create applications and services that interact with the WhatsApp messaging service. These libraries provide access to the WhatsApp API, allowing developers to create custom tools and applications that communicate with WhatsApp users. These libraries can be used to build bots, create custom chat experiences, and more.


Let us look at these libraries in detail below.

whatsapp-web.js

  • Auto-detection of incoming messages, allowing developers to respond quickly.
  • Built-in media upload and download support.
  • Built-in webhooks for automated responses.

Chat-API

  • Allows developers to build applications that integrate with multiple messaging platforms.
  • Provides support for multi-user chat rooms.
  • Allows developers to receive notifications whenever messages are sent or received.

sulla

  • Offers a wide range of analytics and reporting capabilities.
  • Integrates with other third-party services, such as Slack.
  • Powerful set of APIs for automating the WhatsApp messaging experience.

whats2api

  • Full control over incoming messages.
  • Event-driven notifications.
  • Flexible API calls and built-in security features.

whatsapi

  • Highly secure and provides end-to-end encryptions for all messages sent and received.
  • Provides a comprehensive set of features for managing contacts, groups, and conversations.
  • Allows developers to access and control the WhatsApp API directly from their applications.

wasapbot

  • Easy-to-use platform that allows you to quickly build a WhatsApp bot without the need to write any code.
  • Provides a user-friendly interface with a drag-and-drop editor to create sophisticated chatbots.
  • Handle complex conversations and can work with multiple users at the same time.

whatbot

  • Allows users to customize their conversations using a variety of built-in templates.
  • Provides an intuitive interface to set up automated messages and bot responses.
  • Ability to process incoming messages, and send and receive images and videos etc.

Here are the top Javascript libraries for displaying alerts on your websites. All these libraries are customizable and user-friendly; they are the perfect replacement for boring alert boxes.  


The alert() function is a helpful built-in JavaScript feature. When you want the information to reach the user, you utilize the alert() method. This feature will show text in a popup dialogue box on the screen. Unlike every text or message on the screen, the alert box is unique. A message or text is displayed in a popup with an "OK" button. The user cannot perform any tasks when an alert box is displayed on the screen until they hit the "OK" button. Events cause JavaScript functions to be called. There are three diverse types of popup boxes available in JavaScript: alert, confirm, and prompt.  


The greatest alert libraries in Javascript are presented below, carefully reviewed, and approved to benefit users inevitably. The above-mentioned alert() method can be customized, and the dialog box can be designed according to our needs using the libraries. 

sweetalert2- 

  • A responsive and highly customizable Javascript library. 
  • Comprehensible (WAI-ARIA) alternative to JavaScript's popup boxes. 
  • No dependencies required.

notie- 

  • Simple notification, input, and selection suite for javascript. 
  • Alert users and confirm user choices. 
  • Allow users to input information and select choices. 
  • Allow users to select dates. 

tinycon- 

  • Can manipulate favicon, add alert bubbles, and change images. 
  • Adds a single object to the global namespace, and no initialization required. 
  • All attributes of the alert bubble are optimizable.

alertify.js- 

  • Can be integrated with many Javascript frameworks. 
  • Several built-in themes and additional features like asynchronous call-backs are supported. 
  • It is an effective alert or notification system built using javascript. 

AlertifyJS- 

  • a javascript framework for creating visually appealing browser dialogues and warnings. 
  • No external dependencies required. 
  • It is extensible, responsive, and can develop Unobtrusive notifications.

react-native-flash-message- 

  • A react native module for creating flash notifications as well as alerts. 
  • All components are built for global use. 
  • By default, all messages will be shown with transitions. 

smoke.js- 

  • Customized alert system for javascript that is independent of frameworks. 
  • This alert system uses CSS animations and background and, thus, is lightweight. 
  • It is simple to set up and simpler to change the style. 

bootbox- 

  • Uses Twitter’s Bootstrap framework. 
  • JavaScript alert(), confirm(), and other customizable window wrappers. 
  • It is built with the help of Bootstrap and jQuery. 

ChatGPT uses Python programming language. ChatGPT is a variant of the GPT-3 language model for conversational language generation. Here are the top Python ChatGPT libraries that you can use for


  • text generation based on a prompt or seed text,
  • text completion,
  • text classification,
  • question answering,
  • virtual assistants,
  • customer service chatbots,
  • knowledge management systems,
  • machine translation,
  • named-entry recognition,
  • summarization, and more. 


A large-scale language generation model is ChatGPT. Based on a prompt or context that the user offers, ChatGPT produces writing that resembles a human. ChatGPT has received widespread adoption in NLP and is employed in several applications. 


The top 15 Python ChatGPT libraries are shown below. Here is a detailed review of libraries:

ChatGPT:

  • Is a lightweight package to interact with ChatGPT’s API created by OpenAI.
  • Uses reverse engineering official API. 
  • Is a deep learning model that pertains to a large text corpus that is fine-tuned for natural language generation tasks. 
  • Help open an OpenAI API key for working on your Python programming skills.  

nonebot2:

  • Is a Python framework for building chatbots on different messaging platforms like Telegram, Discord, and QQ. 
  • Offers a high-level interface to create chatbots.
  • Helps focus on writing bot logic without worrying about low-level details.
  • Supports plugin-based architecture to extend and customize the bot’s functionalities.

PyChatGPT:

  • ChatGPT API will help with conversation tracking, auto token regeneration, and proxy support. 
  • Offers proxy support and saves conversations to a file.
  • Resumes conversations even after closing the program.
  • Allows you to automatically grab Access Token and log in without involving a browser.

chatgpt-wrapper:

  • Is an open source unofficial Python API, Flask API, and Power CLI, which lets you interact with ChatGPT. 
  • Let you use the powerful ChatGPT bot on the command line or your Python Scripts.
  • Will make leveraging its functionality in your projects easy. 
  • Is an API that helps interact with ChatGPT using Python and Shell.

chatgpt-mirai-qq-bot:

  • Is a Python library used to create a chatbot using the OpenAI GPT model
  • Integrates it with QQ, a popular messaging platform in China. 
  • Allows you to create a chatbot to generate natural language responses for user inputs. 
  • We can integrate the bot with QQ, allowing users to interact with the bot through chat messages.

chatGPT-discord-bot:

  • Is a Python library for creating a chatbot using the OpenAI GPT model
  • Integrats ot with Discord, a popular voice and messaging platform.  
  • Allows us to create a chatbot to generate natural language responses for user inputs. 
  • The OpenAI GPT model pertained to a massive corpus of text and fine-tuned it for language generation tasks.

QChatGPT:

  • Offers support for black and white list system, user management, custom word style
  • And also, persona, rate limiting, and private and group chats.
  • Support sensitive word filtering to avoid account risks; replies will fit perfectly with the context. 
  • Offers perfect multi-API-key management, automatic switching of excess quota,
  • Supports present command texts.  

ChineseAIDungeonChatGPT:

  • Is a Python library that uses an AI dungeon with ChatGPT for creating a storytelling model. 
  • Designed to be used with a game, ‘AI Dungeon’, which will allow players to generate text-based game scenarios using the GPT models.  
  • Offers a high-level interface to create chatbots.
  • Help you generate natural language responses for user inputs. 

Openaibot:

  • Is a Python library for creating chatbots using the OpenAI GPT model
  • Offers a high-level interface to build chatbots which generate natural language responses.
  • Offers an easy-to-use interface that will help interact with the OpenAI API to start building chatbots. 
  • Includes built-in support for handling request throttling and user authentication.

chatgpt-api: 

  • Is an unofficial ChatGPT API based on Daniel Gross’s WhatsApp GPT. 
  • Uses chromium and playwright for opening browser and parsing HTML. 
  • Used for development purposes only. 

chatgpt-python: 

  • Is an unofficial Python SDK for OpenAI’s ChatGPT. 
  • Is a library which will allow developers to easily integrate the ChatGPT into their Python based projects.  
  • Generates error codes for explaining what went wrong with the ChatGPT. 

chatgpt-conversation: 

  • Let us have a conversation with ChatGPT with our voice and let it talk back to us.  

stackexplain: 

  • Is a Python library which is used in Server and Runtime Environment applications.  

docGPT: 

  • ChatGPT directly is within the Google Docs as an Editor Add-on. 

TextRL:

  • Can do text generation with reinforcement learning with the help of huggingface’s transformer.
  • Reinforcement Learning with Human Feedback’s implementation of ChatGPT of human interaction
  • For improving generation model with reinforcement learning.

React notification libraries allow developers to add notifications to React applications. Notifications can inform users of events, such as when a task is complete, or an error has occurred. Notification libraries provide various customization options. It includes styling and custom logic for when we display notifications.  

Different types of react available notification libraries:  

Simple React Notifications (SRN):  

SRN is a simple library for adding notifications to React applications. SRN supports alert, info, success, and error styling. It provides a callback when we dismiss a notification.  

React-Notification-System:  

This library is a more comprehensive solution for adding notifications to React applications. It allows complex logic to determine when we display the notifications. It allows for custom styling notifications and adding buttons (with callbacks).  

React-Toastify:  

React Toastify is a simple notification library for React apps. It features custom styling and several built-in animations for displaying notifications.  

React Notiflix:  

React Notiflix is a comprehensive library for adding notifications to React applications. It includes various options for customizing and styling notifications. It will support many different types of notifications.  

React Notification Redux:  

React Notification Redux is another comprehensive library for adding notifications to React applications. It includes many different features for customizing and styling the notifications. It includes support for many types of notifications.  

 

Toastify Package is a non-blocking notifications component for React apps. It provides a complete and customizable toast notification system for React applications. With Toastify, users can pause toasts and adjust the order of toasts using the toastId. Toastify offers other features like custom icons and progress bar/loading indicators. Thus, Toastify is for anyone looking for a scalable server's state management library for their app development. This library offers users a Spec compliant notification for user devices. To install Toastify, use the following command in your terminal: npm install react-toastify.  

 

Firebase Cloud Messaging is a cross-platform messaging solution. It provides rich support for developing and delivering secure notifications to users' devices. It is suitable for the web, Android, iOS, and others.  

Different features that are available in react notification libraries: 

  • Alerts:  

These simple notifications usually pop up with a message, action button, or link.  

  • Messages:  

Messages provide detailed notifications. It usually appears near the bottom of a page or window and includes a message and a link or action button.  

  • Tooltips:  

Tooltips are mini notifications that usually appear when a user hovers over an element. They usually provide a brief explanation.  

  • Popup Windows:  

Popup windows provide more comprehensive notifications that can alert or inform a user. These often prompt a user for extra information or a specific action.  

  • Pages:  

Pages are notifications that cover an entire page of the application. They usually provide more detailed information about a notification or action.  

  • System Tray:  

System tray notifications are comprehensive notifications. It can inform or remind users of an action.  

  • Sticky Notifications:  

Sticky notifications are notifications we display until the user dismisses them. They can provide useful reminders.  

  • React Native Notifications:  

React Native Notifications provide platform-specific notifications for both the application and the browser.  

 

React notification libraries are from simple alerts informing change users to complex notifications. We can inform users of new or changed web services and APIs. We can use APIs to identify API executions and validate data updates.  

 

Simple alert notifications can allow users to take immediate action. They can help alert users to system events or errors and inform users of changes to web content. It provides feedback on user interactions.  

 

More sophisticated notifications help notify users of web services and APIs. These notifications can improve user experience and protect against potential security threats. It helps track API executions, receive real-time system events, and validate data updates. It helps track API usage for analytics.  

 

Notifications can generate detailed reports of user interactions and data updates. It can improve system performance and user experience. This detailed reporting can provide insights into the usability of applications and APIs. It allows developers to identify areas for improvement and optimize user experiences.  

Tips for setting up and using a react notification library: 

1. Make sure you have the necessary libraries installed.  

2. If you use a create-react-app for setting up your project, you can install the libraries using npm:  

 ```npm install react-notifications-component```  

3. Integrate your library into your React project.  

4. You can then use the library to create notifications with your message and styling. The react-notifications component has several helpful methods for creating notifications. You can create success, info, warning, and error.  

Pointers on how to best use React notification libraries in your applications: 

1. Understand how your users enjoy notifications 

Ensure you have a firm grasp of the needs of your users, which will inform how we should use notifications.  

2. Decide on the type of notifications 

React notification libraries offer both simple alerts and full-fledged notification hubs.  

3. Define user options 

Consider allowing users the choice of which notifications they receive. This can involve prompt alerts for notifications and a hub for important tidbits.  

4. Utilise persistent notifications 

Consider utilizing persistent notifications to bring attention back to a certain area. It happens if the user needs to respond or interact with a notification.  

5. Use customized notifications  

Differentiate various notifications with customized color, text size, and sound features.  

6. Make notifications actionable 

Don't make a notification a passive element on the screen. Allow users to act further on notifications, such as marking them as read or opening a URL.  

7. Incorporate testing  

Using any library involves testing it within your project. Use unit tests to ensure your notifications every time you change your codebase.  

When writing about these Libraries, it is important to cover the following key points:  

  • Different types of libraries available:  

Different React Notifications Libraries provide components that we can use for notifications.  

  • Integrations with external services:  

We can integrate React Notifications Libraries with external services for sending real-time notifications.  

  • Examples of implementation:  

It is important to provide examples and practical implementations. It helps readers to understand how to use them.  

  • Using and customizing components:  

It provides tutorials for using and customizing components from React Notification Libraries.  

  • Information on sound and visual elements:  

It provides information on enabling sound and visual elements for libraries.  

 

Snackbar notification messages are short messages that alert or provide information to users. They appear at the bottom part of the device screen and can contain a brief message, an action, or both. They are used for new releases and changes to settings, user account updates, or errors.  

 

React has libraries for snackbar notifications, like Toastify, Notifications, and React-Equity Notification. These libraries allow users to build icons, progress bars, indicators, and close buttons. Many JavaScript libraries can be integrated with React applications.  

 

Popup boxes are a common feature found in most react notification libraries. The popup box can contain a close button, a progress bar, loading indicators, and custom icons.  

 

React notification libraries provide developers with a straightforward and versatile solution. It helps in alerting users of the app or website changes. Developers can create notifications with custom positioning, animations, and sound effects with code. Notifications can be triggered, AJAX requests, or from the component's state.  

 

Using React notification libraries can help developers create dynamic user experiences. They should do so without wasting time writing boilerplate code. Notification libraries can be customized and enhanced with extra features. It provides developers with plenty of flexibility when crafting their applications.  

 

Let's look at each library in detail. The links allow you to access package commands, installation notes, and code snippets.  

sweetalert2  

  • It offers a wide range of customization options according to your needs.  
  • It has a range of animated transitions, making it appealing and fun to use.  
  • Provides support for many inputs, allowing users to include various information.  

react-toastify  

  • Offers four different positions for toast notifications.  
  • Developers can use a progress bar to represent the progress of a task.  
  • Suspends the toast notifications for mobile viewports. So they don't obstruct the user's view.  

react-native-push-notifications  

  • It is lightweight and has no setup or maintenance time required.  
  • Supports cloud message delivery. It makes ensuring your messages reach their intended destinations even easier.  
  • Offers robust targeting capabilities.  

notie  

  • It has no external dependencies, making it lightweight and easy to use.  
  • It is built with native UI elements. It supports enhanced user experience in mobile and touch interaction devices.  
  • Provides easy customization of color, animation speed, labels, dismiss delay, and more.  

react-toast-notifications  

  • It is device responsive.  
  • It adopts a modular approach, making it extendable and customizable.  
  • It uses React Hooks, giving developers more flexibility when dealing with toast notifications.  

react-notifications-component  

  • It can be integrated into any React app with minimal effort.  
  • Users can receive real-time notifications when an event is triggered in the app.  
  • It can be completely customized and styled to match the look and feel of an existing app.  

react-s-alert  

  • Supports different types of alerts such as success, warning, and error.  
  • Features a very straightforward setup process.  
  • It alerts as per the device's width.  

FAQ 

What is the react-toastify library, and how does it work?  

React-Toastify library provides customizable notification messages (or "toasts") to web applications. Toasts can display success and error messages without taking up screen real estate. It works by providing a component for rendering toast. It helps in letting you display them with a single function call. You can customize toast properties such as position, timing, and styling. It allows them to fit into your web application.  

 

How can I use this library to create non-blocking notifications within an application?  

The library provides a React component to create non-blocking notifications. First, install the library using yarn or NPM within a React application. Next, import the Notification component into a React file. After that, create the non-blocking notifications within the render function. Include the props for creating the notifications, like 'message', 'type', 'title', and 'onClose'. Finally, add the component to the application and pass the props. This will enable the application to make non-blocking notifications.  

 

What features does Scalable Server State Management Library offer for toast notification messages?  

The Scalable Server State Management Library has the features for toast notification messages:  

  • Push notifications – The library lets us push timely client updates. It informs the user in real-time.  
  • Persistent notifications – Toast notifications can be recurrent. They don't disappear after a user action, reminding users of their activities.  
  • Customizable display – Toast notifications are customizable text, image, and color. We can tailor it to any brand or language.  
  • Targeting – Toast notifications can reach specific audiences or segments. It allows users to receive relevant messages.  
  • Segmentation – Toast notifications can separate segments of users. It helps send it to different user groups that can receive tailored messages.  
  • Analytics – The library allows for the collection and analysis of user data. It helps understand user behavior and determine where notifications are most effective.  
  •  

Is there a comprehensive guide on how to use Cloud Messaging with a React app?  

Yes, a comprehensive guide is available online. It was created by the React team on how to use Cloud Messaging with a React app.  

 

How would an experienced user rate the notification library available in the market?  

Notifications are becoming a more important part of the application experience. The experienced user would rate the current notification libraries available in the market. Current libraries generally offer a good selection of features. Those are designed to make notification management and customization very convenient. Many popular libraries are well-tested so users can get up and running.  

 

What are the best practices and tips for creating snackbar notification messages?  

  • First, identify the type of action. It needs to be conveyed by the notification and determine the appropriate text and style to go with it. Aim for short messages with clear language. Also, avoid using jargon or technical terminology.  
  • Ensure the message is written and contains a call to action.  
  • Use a consistent location for the snackbar to appear. It ensures that it doesn't interfere with the layout or flow of the app.  
  • Make sure the snackbar is visible and within reach of the user.  
  • If complete success isn't guaranteed, use phrases like "Entity updated " or "Task completed".  
  • Set a reasonable timeout so that the message will be visible for an adequate time.  
  • Place a close icon or an appropriate action next to the message for the user to dismiss it. They offer appropriate feedback for possible errors or failures.  
  • If snackbars appear, consider collapsing rules where we can combine many snackbars.  
  • Use snackbars to inform users of updates, changes, or other pertinent information. Aim to provide a consistent and pleasant experience when using snackbars.  
  • Test out the notifications with alternative user scenarios. It helps ensure that the user experience is not disadvantaged.  
  •  

Can Cloud Messaging send notifications from one system to another in an application?  

Yes, cloud messaging can send notifications from one system to another in the application. FCM is a free and reliable service hosted by Google. It enables developers to send messages and notifications.  

 

Are there any alternatives or competitors of the react-toastify library? Will they provide similar functionality and benefits to this library?  

Other alternatives for react-toastify include Toastr, Redux toastr, Sweetalert2, and React Notifications. Each library provides its unique advantages, so it is up to you to decide which one best suits your needs.  

 

Can I create customizable components using the react-toastify library for my React app?  

Yes, creating completely customizable components using the react-toastify library is possible. The library allows great customization when creating components. It includes customizing the toast position, adding animations, and customizing styling options.  

 

How does react-toastify compare with other popular notification libraries available today?  

React-Toastify is among the popular notification libraries available. It has become popular due to its ease of use. It offers various features to customize notifications with minimal code. React-toastify can be used with big data sets due to its use of virtual DOM to keep track of its components. Performance has been benchmarked at higher speeds than some of its competitors. React-Toastify also has built-in accessibility features, which follow many accessibility standards. In general, React-Toastify is an ideal library for creating notifications. It offers a great alternative to some of the other popular options available today. 

This is spring boot library which is used to service registry

Here are the top python telegram API libraries that any developer can access to simplify the creation and maintenance of telegram bots and other services.   


The messaging service Telegram provides two diverse types of APIs for programmers to use. Using the Bot API, you may quickly make software that uses Telegram messages as an interface. You can create your own uniquely designed Telegram clients using the TDLib and Telegram API. Many uses for the Telegram Bot API are possible, ranging from systems that control notifications to video or image editing. Creating interactive games or providing individualized news updates is an additional potential use for the Telegram Bot API.  


The best Python Telegram API libraries are presented below, precisely categorized, and picked based on reviews and features. 

python-telegram-bot- 

  • Asynchronous interface for telegram bot API. 
  • Featuring high-level classes for easy implementation. 
  • Optional 3rd party dependencies are available.

Telethon- 

  • Interacting with telegram becomes easy with this python library. 
  • It is an MTProto library. 
  • Can also be used with telegram bots. 

pyTelegramBotAPI- 

  • Extensible python API for Telegram bot. 
  • Contains message handlers and makes function names customizable.  
  • It is an HTTP-based interface. 

aiogram- 

  • Written with asyncio and aiohttp. 
  • The framework is completely asynchronous. 
  • The client/server framework is concurrent. 

pyrogram- 

  • Interact with the main telegram API through a user account. 
  • Easy install using pip. 
  • It's asynchronous but can be used synchronously if needed.

telegramscraper- 

  • Many accounts are supported at the same time. 
  • Telegram scrapper and adder. 
  • Scrapping is possible for public groups in bulk. 

pytgcalls- 

  • Exclusive for telegram group calls. 
  • Uses NodeJS’s WebRTC library. 
  • Support Pyrogram and Telethon clients. 

opentele- 

  • For switching between tdata and telethon sessions. 
  • Real data can be used to randomize device info. 
  • Bot detection can be avoided. 

telemirror- 

  • Client API for telegram message forwarding. 
  • Message filters to identify incoming messages. 
  • Mapping of source and target channels.

python-telegram-handler- 

  • Handles logs using telegram bot API. 
  • Easy use with registering and obtaining the authentication token.  
  • If an exception, the handler retrieves chat_id. 

aiotg- 

  • Easy and declarative API. 
  • Hassle-free setup - no need for SSL certificates or static IP. 
  • Built-in support for analytics via chatbase.com. 
  • Automatic handling of Telegram API throttling or timeouts. 

Top libraries for integrating and working with IOS push notifications down here. You can reuse them modularly in your apps and websites to include push notification services.  


A message on an Apple device like an iPhone is an iOS push notification. iOS device users must expressly consent to receive push notifications from an app. Publishers of mobile apps can send push notifications to consumers' mobile devices if they opt in. Additionally, receiving them does not need iOS users to be in the app or using their smartphones at the time. The app can generate notifications locally or remotely by a server you govern. Local notifications use events, such as a time or place, to generate notice content and start the notification delivery. Your company's server generates push notifications for remote notifications, and Apple Push Notification Service (APNs) manages the delivery.   


The most rated IOS push notification libraries are listed below to ease the process of push notification integration for the developers. 

gorush- 

  • Micro-server using GIN framework written in Golang (Go) language. 
  • Supports command-line and Web API to send push notifications. 
  • If the server answer fails, the notification can be resent. 

react-native-push-notification- 

  • Local and Remote notifications using React-Native and Java. 
  • Custom sounds can be added to our notifications. 
  • Can check if a channel exists and delete channels if needed.

PushSharp- 

  • A library aiming the server-side functionalities. 
  • Can send push notifications to both IOS and OSX. 
  • Can also send customizable notifications to Android, windows, etc. 

apns2- 

  • Supports new Apple Token-Based Authentication (JWT). 
  • Simple, flexible, and can push mutable notifications. 
  • Is a Go package using the new HTTP/2 Push provider API.

PushNotifications- 

  • An app used for testing push notifications on iOS and Android. 
  • Support using certificate and token for authentication with APNS. 
  • It has auto-save settings. 

pushy- 

  • A java library to send APNs to push notifications. 
  • Is asynchronous and supports industrial-scale applications. 
  • Efficient in maintaining multiple parallel connections for sending many notifications simultaneously. 

react-native-onesignal- 

  • A free email, sms, push notification, and in-app message service for mobile apps. 
  • Specifically for pushing One-signal notifications in IOS. 
  • Developed using React-Native (Typescript). 

grocer- 

  • The most extensible interface with the Apple Push Notifications. 
  • Is built completely using Ruby. 
  • Is advisable to reuse the same connection to send multiple notifications.

fcm-django- 

  • Django app for Firebase Cloud Messaging.  
  • Used as a unified platform for sending push notifications to mobile devices & browsers. 
  • Admin actions for testing single and bulk notification sending.

Here are the best python notification libraries. These libraries are useful for sending notifications to users and letting them know how their function is progressing.   


Notifications are necessary to inform the user of updates or other important bits of information. It is a small text message which will appear on the desktop or mobile screen. People who receive notifications find it easier to remember things. The user can concentrate on momentous events while ignoring less important ones with the help of notifications. After finishing the task, we can refer to the notifications saved in the notification bar. Simple libraries or modules developed using python help create and push notifications in any platform like e-mail, websites, etc.  


Below is an appropriately tailored list of the top python notification libraries, focusing on helping developers with any task involving notifications. 

Knockknock -  

  • Used in deep training models. 
  • Used to notify when training is complete. 
  • Also used to notify when training crashes. 
  • Can set up notifications in email, slack, telegram, etc.

notify-py -  

  • Send cross-platform desktop notifications. 
  • Can send notifications with icons, sounds, titles, and no-block functionality.  
  • Does not require any external dependencies. 

notifiers - 

  • An effortless way to send notifications. 
  • Simple and unified interface for all notification providers. 
  • Built out of stable and well-known dependencies. 

apprise -  

  • A typical and simple notification syntax. 
  • Let you transfer the notification to all universally used notification services. 
  • All messages are sent asynchronously. 
  • Image and attachment handling is supported. 

Stream-Framework -  

  • Python library, which uses Cassandra or Redis.  
  • Apart from notification systems, they are used to build news feeds and activity streams. 
  • Cloud based feed technology. 

django-push-notifications - 

  • Django based library to send push notifications. 
  • Via GCM or APNS. 
  • Supports single as well as bulk notifications. 

django-notifications - 

  • Used for building GitHub notifications.  
  • Derived from Django-activity-stream. 
  • Arbitrary data can be attached to the notifications. 

PyAPNs - 

  • Exclusive for interacting with apple push notifications. 
  • It helps with reducing unnecessary message overhead. 
  • Can also send complicated alerts with custom buttons and payload arguments.

Windows-10-Toast-Notifications -  

  • Exclusive for displaying Windows 10 Toast Notifications. 
  • Useful in Windows GUI development. 
  • Easy to use and deploy. 

Java Redis libraries often include connection pooling for efficiently managing connections to the Redis server. It often includes built-in support for deserializing and serializing Java objects to and from Redis data structures like lists and hashes.  


It supports transactions that will allow multiple operations to be performed atomically. Redis libraries support Redis sub/pub messaging, allowing clients to subscribe to channels and receive real time messages. It allows Lua scripts to be executed on the Redis server by offering added performance and flexibility. It offers support for the Redis cluster, allowing clients to connect and interact with it. 


Here is the list of the top 10 Java Redis Libraries handpicked for helping developers: 

JavaGuide: 

  • Offers an easy-to-use API to interact with Redis, like simple commands for setting and getting values, incrementing or decrementing values, and working with Redis lists, sets, and hashes.  
  • Is designed to be highly performant and optimized for speed, which uses the Jedis client library for communicating with Redis, which is optimized for performance.  
  • Supports Redis transactions, allowing multiple Redis commands to be executed as a single transaction, ensuring consistency and atomicity.   

mall: 

  • Has a small footprint and is designed to be lightweight, making it suitable for use in resource-constrained environments. 
  • Includes connection pooling for minimizing the overhead of creating and destroying Redis connections. 
  • Is thread-safe, allowing multiple threads to access Redis concurrently without requiring external synchronization. 

redisson: 

  • Offers several distributed data structures like queues, locks, maps, and sets, which can be used for multiple JVM instances or servers.  
  • Supports reactive programming through reactive systems, allowing developers to work with Redis using non-blocking APIs.  
  • Offers integration with the Spring Framework, allowing developers to use Redisson with Spring-based applications.   

eladmin: 

  • Is an open source library that offers a framework for building web-based administration panels.  
  • Is designed to be modular, allowing developers to add or remove features as required easily. 
  • Offers a simple and intuitive API for performing CRUD operations on database entities.  

zheng: 

  • Offers different methods for assessing the quality of scRNA-seq data, like evaluating the number of genes detected, the percentage of mitochondrial reads, and the number of genes detected. 
  • Provides many clustering methods to group cells depending on gene expression similarity. 
  • Offers methods for inferring developmental trajectories from scRNA-seq using graph-based approaches. 

springboot-learning-example: 

  • Offers examples of using different Spring Boot functionalities and features for building web applications, microservices, and RESTful services. 
  • Contains different examples from simple Hello World applications to more complex microservices with API documentation and database integration. 
  • Offers examples of how to implement basic and advanced security features in your Spring Boot applications using Spring Security.  

SpringBoot-learning: 

  • Offers pre-configured Spring Boot projects which can be easily cloned and started with the help of a few commands.  
  • Includes examples of how to write integration and unit tests for your Spring Boot application using Mockito and JUnit.  
  • Offers examples of deploying Spring Boot applications on platforms like Kubernetes, Heroku, and Cloud Foundry. 

flink-learning: 

  • Is a collection of examples and tutorials which demonstrate how to use Apache Flink to build real time stream processing applications. 
  • Contains various examples, from simple word count applications to more complex projects demonstrating how to use Flink with other technologies like HBase, Cassandra, and Kafka.    
  • Is a valuable resource for developers who want to learn how to use Flink to build scalable and fault-tolerant stream processing applications.  

mall-learning: 

  • Contains examples from simple e-commerce applications to more complex projects that demonstrate how to use Spring Boot with other technologies like Redis, RabbitMQ, and Elasticsearch.  
  • Offers various examples and tutorials covering different aspects of e-commerce application development, making it easier for developers to start building their own e-commerce applications.  
  • Includes examples of writing unit and integration tests for your e-commerce application using Mockito and JUnit.   

source-code-hunter: 

  • Offers a powerful search engine that will allow developers to quickly search for source code snippets from popular programming languages like Python, JavaScript, and Java.  
  • Offers different sorting and filtering options for helping developers narrow search results based on repository stars, code languages, and repository forks. 
  • Offers syntax highlighting for code snippets, which makes it easier for developers to read and understand code examples.  

Trending Discussions on Messaging

Error APNS device token not set before retrieving FCM Token for Sender ID

java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest;

How to register ServiceBusClient for dependency injection?

uploaded an APK which has an activity,activity alias,service or broadcast receiver with intentfilter, but without 'android : exported' property set

How to solve FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore problem?

Mandatory Consent for Admob User Messaging Platform

MissingPluginException(No implementation found for method Messaging#requestPermission on channel firebase_messaging

Error in retrieving notification_key for group messaging in FCM

Firestore Push Notification "time out" error Notification doesn't always get sent

Google AdMob new SDK setup for iOS : SKAdNetworkItems, NSUserTrackingUsageDescription, ATTrackingManager. Guideline 5.1.2 - Legal - Privacy - Data Use

QUESTION

Error APNS device token not set before retrieving FCM Token for Sender ID

Asked 2022-Mar-01 at 17:08

I 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:58

This 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.

Source https://stackoverflow.com/questions/69485088

QUESTION

java.lang.NoSuchMethodError: No virtual method setSkipClientToken(Z)V in class Lcom/facebook/GraphRequest;

Asked 2022-Feb-25 at 23:22

It 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:22

We 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

Source https://stackoverflow.com/questions/71256006

QUESTION

How to register ServiceBusClient for dependency injection?

Asked 2022-Feb-08 at 14:11

I’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)'

enter image description here

If anyone can help with this that'll be great!

ANSWER

Answered 2021-Sep-02 at 20:03

ServiceBusClientBuilderExtensions.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&lt;ServiceBusClient, ServiceBusClientOptions&gt; AddServiceBusClient&lt;TBuilder&gt;(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&lt;ServiceBusClient, ServiceBusClientOptions&gt; AddServiceBusClient&lt;TBuilder&gt;(this TBuilder builder, string connectionString)
6            where TBuilder : IAzureClientFactoryBuilder
7public override void Configure(IFunctionsHostBuilder builder)
8{
9    builder.Services.AddAzureClients(clientsBuilder =&gt;
10    {
11        clientsBuilder.AddServiceBusClient(Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary)
12          // (Optional) Provide name for instance to retrieve by with DI
13          .WithName(&quot;Client1Name&quot;)
14          // (Optional) Override ServiceBusClientOptions (e.g. change retry settings)
15          .ConfigureOptions(options =&gt;
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&lt;ServiceBusClient, ServiceBusClientOptions&gt; AddServiceBusClient&lt;TBuilder&gt;(this TBuilder builder, string connectionString)
6            where TBuilder : IAzureClientFactoryBuilder
7public override void Configure(IFunctionsHostBuilder builder)
8{
9    builder.Services.AddAzureClients(clientsBuilder =&gt;
10    {
11        clientsBuilder.AddServiceBusClient(Typsy.Domain.Configuration.Settings.Instance().Connections.ServiceBusPrimary)
12          // (Optional) Provide name for instance to retrieve by with DI
13          .WithName(&quot;Client1Name&quot;)
14          // (Optional) Override ServiceBusClientOptions (e.g. change retry settings)
15          .ConfigureOptions(options =&gt;
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&lt;ServiceBusClient&gt; serviceBusClientFactory)
24 {
25     // Wherever you need the ServiceBusClient
26     ServiceBusClient singletonClient1 = serviceBusClientFactory.CreateClient(&quot;Client1Name&quot;)
27 }
28

Source https://stackoverflow.com/questions/68688838

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:56

I'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    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
2    &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
3        package=&quot;**********&quot;&gt;
4        &lt;!-- 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. --&gt;
9        &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
10        &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; /&gt;
11        &lt;uses-feature android:name=&quot;android.hardware.camera&quot; /&gt;
12        &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
13        &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
14        &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
15        &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;
16        &lt;uses-permission android:name=&quot;android.permission.ACCESS_BACKGROUND_LOCATION&quot; /&gt;
17        &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot;/&gt;
18        &lt;uses-permission android:name=&quot;android.permission.FOREGROUND_SERVICE&quot;/&gt;
19        &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
20        &lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot;/&gt;
21        &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;
22        &lt;uses-permission android:name=&quot;android.permission.ACTIVITY_RECOGNITION&quot; /&gt;
23        &lt;uses-permission android:name=&quot;com.google.android.gms.permission.ACTIVITY_RECOGNITION&quot; /&gt;
24    
25    
26        &lt;application
27            android:name=&quot;io.flutter.app.FlutterApplication&quot;
28            android:label=&quot;*****&quot;
29            android:requestLegacyExternalStorage=&quot;true&quot;
30            android:usesCleartextTraffic=&quot;true&quot;
31            android:icon=&quot;@mipmap/ic_launcher&quot;&gt;
32    
33    
34            &lt;meta-data
35              android:name=&quot;com.google.firebase.messaging.default_notification_icon&quot;
36              android:resource=&quot;@drawable/ic_stat_artboard_1&quot; /&gt;
37    
38            &lt;meta-data android:name=&quot;com.google.android.geo.API_KEY&quot;
39                android:value=&quot;Z*********&quot;/&gt;
40    
41            &lt;provider
42                android:name=&quot;vn.hunghd.flutterdownloader.DownloadedFileProvider&quot;
43                android:authorities=&quot;im.mingguang.mingguang_app.flutter_downloader.provider&quot;
44                android:grantUriPermissions=&quot;true&quot;
45                android:requestLegacyExternalStorage=&quot;true&quot;&gt;
46                &lt;meta-data
47                    android:name=&quot;android.support.FILE_PROVIDER_PATHS&quot;
48                    android:resource=&quot;@xml/provider_paths&quot;/&gt;
49            &lt;/provider&gt;
50    
51            &lt;provider
52        android:name=&quot;androidx.core.content.FileProvider&quot;
53        android:authorities=&quot;${applicationId}.provider&quot;
54        android:grantUriPermissions=&quot;true&quot;&gt;
55        &lt;meta-data
56            android:name=&quot;android.support.FILE_PROVIDER_PATHS&quot;
57            android:resource=&quot;@xml/provider_paths&quot;/&gt;
58    &lt;/provider&gt;
59            &lt;activity
60                android:name=&quot;.MainActivity&quot;
61                android:launchMode=&quot;singleTop&quot;
62                android:theme=&quot;@style/LaunchTheme&quot;
63                android:configChanges=&quot;orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode&quot;
64                android:hardwareAccelerated=&quot;true&quot;
65                android:exported=&quot;true&quot;
66                android:windowSoftInputMode=&quot;adjustResize&quot;&gt;
67                &lt;intent-filter&gt;
68                    &lt;action android:name=&quot;android.intent.action.MAIN&quot;/&gt;
69                    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;
70                    &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
71                &lt;/intent-filter&gt;
72                &lt;intent-filter&gt;
73                    &lt;action android:name=&quot;FLUTTER_NOTIFICATION_CLICK&quot; /&gt;
74                    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;
75                &lt;/intent-filter&gt;
76            &lt;/activity&gt;
77            &lt;!-- Don't delete the meta-data below.
78                 This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --&gt;
79            &lt;meta-data
80                android:name=&quot;flutterEmbedding&quot;
81                android:value=&quot;2&quot; /&gt;
82        &lt;/application&gt;
83    &lt;/manifest&gt;
84

Play Console Error

enter image description here

ANSWER

Answered 2022-Jan-12 at 23:56

I face the same Issue but i solved by writing android:exported="true" in activity bellow the android:name=".MainActivity" image shown

Source https://stackoverflow.com/questions/70684516

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:08

I 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 = () =&gt; {
7  const [username, setUsername] = useState&lt;string | null&gt;(null)
8
9  const [currentUser, setCurrentUser] = useState&lt;User | null&gt;(null)
10
11  useEffect(() =&gt; {
12    let unsubscribe: void | Unsubscribe
13
14    onAuthStateChanged(auth, (user) =&gt; {
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) =&gt; {
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 = () =&gt; {
7  const [username, setUsername] = useState&lt;string | null&gt;(null)
8
9  const [currentUser, setCurrentUser] = useState&lt;User | null&gt;(null)
10
11  useEffect(() =&gt; {
12    let unsubscribe: void | Unsubscribe
13
14    onAuthStateChanged(auth, (user) =&gt; {
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) =&gt; {
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 = () =&gt; {
7  const [username, setUsername] = useState&lt;string | null&gt;(null)
8
9  const [currentUser, setCurrentUser] = useState&lt;User | null&gt;(null)
10
11  useEffect(() =&gt; {
12    let unsubscribe: void | Unsubscribe
13
14    onAuthStateChanged(auth, (user) =&gt; {
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) =&gt; {
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: &quot;firestore-lite&quot;
66    _app: FirebaseAppImpl
67    _automaticDataCollectionEnabled: false
68    _config: {name: &quot;[DEFAULT]&quot;, automaticDataCollectionEnabled: false}
69    _container: ComponentContainer {name: &quot;[DEFAULT]&quot;, providers: Map(15)}
70    _isDeleted: false
71    _name: &quot;[DEFAULT]&quot;
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: &quot;next-firebase-fireship&quot;, database: &quot;(default)&quot;}
90    _persistenceKey: &quot;(lite)&quot;
91    _settings: ee {host: &quot;firestore.googleapis.com&quot;, 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:07

Using 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 = () =&gt; {
7  const [username, setUsername] = useState&lt;string | null&gt;(null)
8
9  const [currentUser, setCurrentUser] = useState&lt;User | null&gt;(null)
10
11  useEffect(() =&gt; {
12    let unsubscribe: void | Unsubscribe
13
14    onAuthStateChanged(auth, (user) =&gt; {
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) =&gt; {
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: &quot;firestore-lite&quot;
66    _app: FirebaseAppImpl
67    _automaticDataCollectionEnabled: false
68    _config: {name: &quot;[DEFAULT]&quot;, automaticDataCollectionEnabled: false}
69    _container: ComponentContainer {name: &quot;[DEFAULT]&quot;, providers: Map(15)}
70    _isDeleted: false
71    _name: &quot;[DEFAULT]&quot;
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: &quot;next-firebase-fireship&quot;, database: &quot;(default)&quot;}
90    _persistenceKey: &quot;(lite)&quot;
91    _settings: ee {host: &quot;firestore.googleapis.com&quot;, 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 = () =&gt; {
7  const [username, setUsername] = useState&lt;string | null&gt;(null)
8
9  const [currentUser, setCurrentUser] = useState&lt;User | null&gt;(null)
10
11  useEffect(() =&gt; {
12    let unsubscribe: void | Unsubscribe
13
14    onAuthStateChanged(auth, (user) =&gt; {
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) =&gt; {
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: &quot;firestore-lite&quot;
66    _app: FirebaseAppImpl
67    _automaticDataCollectionEnabled: false
68    _config: {name: &quot;[DEFAULT]&quot;, automaticDataCollectionEnabled: false}
69    _container: ComponentContainer {name: &quot;[DEFAULT]&quot;, providers: Map(15)}
70    _isDeleted: false
71    _name: &quot;[DEFAULT]&quot;
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: &quot;next-firebase-fireship&quot;, database: &quot;(default)&quot;}
90    _persistenceKey: &quot;(lite)&quot;
91    _settings: ee {host: &quot;firestore.googleapis.com&quot;, 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 and DocumentChange, SnapshotListenerOptions, SnapshotMetadata, SnapshotOptions and Unsubscribe objects are not included in lite 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 = () =&gt; {
7  const [username, setUsername] = useState&lt;string | null&gt;(null)
8
9  const [currentUser, setCurrentUser] = useState&lt;User | null&gt;(null)
10
11  useEffect(() =&gt; {
12    let unsubscribe: void | Unsubscribe
13
14    onAuthStateChanged(auth, (user) =&gt; {
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) =&gt; {
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: &quot;firestore-lite&quot;
66    _app: FirebaseAppImpl
67    _automaticDataCollectionEnabled: false
68    _config: {name: &quot;[DEFAULT]&quot;, automaticDataCollectionEnabled: false}
69    _container: ComponentContainer {name: &quot;[DEFAULT]&quot;, providers: Map(15)}
70    _isDeleted: false
71    _name: &quot;[DEFAULT]&quot;
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: &quot;next-firebase-fireship&quot;, database: &quot;(default)&quot;}
90    _persistenceKey: &quot;(lite)&quot;
91    _settings: ee {host: &quot;firestore.googleapis.com&quot;, 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 &quot;db&quot; is defined and initialized
100const db = getFirestore();
101// console.log(db);
102
103const colRef = collection(db, &quot;collection_name&quot;);
104

Source https://stackoverflow.com/questions/69047904

QUESTION

Mandatory Consent for Admob User Messaging Platform

Asked 2021-Dec-12 at 16:09

I 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:50

I 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(&quot;IABTCF_VendorConsents&quot;, null) != &quot;0&quot;
3

Source https://stackoverflow.com/questions/69307205

QUESTION

MissingPluginException(No implementation found for method Messaging#requestPermission on channel firebase_messaging

Asked 2021-Dec-07 at 05:13
1final 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:11

Terminate the current running session.

Do flutter pub get in your terminal

Then run again.

Source https://stackoverflow.com/questions/69880191

QUESTION

Error in retrieving notification_key for group messaging in FCM

Asked 2021-Aug-22 at 06:09

I 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

enter image description here

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:09

It was a silly mistake (thanks to docs as always), the request body should NOT be {} but empty.

enter image description here

Source https://stackoverflow.com/questions/68843537

QUESTION

Firestore Push Notification &quot;time out&quot; error Notification doesn't always get sent

Asked 2021-Jul-13 at 09:43

I 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) =&gt; {
2
3    if (request.method !== &quot;POST&quot;) {
4        response.status(400).send(&quot;Send it using post request&quot;);
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 === &quot;&quot; || fromUid === &quot;&quot; || fcm === &quot;&quot;) {
16        response.status(400).send(&quot;Parameter is missing!&quot;);
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        &quot;apns-collapse-id&quot;: 'toUid'
31      },
32      payload: {
33        aps: {
34          sound: 'default'
35        },
36        &quot;data&quot;: {
37          &quot;fromUid&quot;: fromUid,
38          &quot;type&quot;: 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(&quot;Done&quot;);
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) =&gt; {
2
3    if (request.method !== &quot;POST&quot;) {
4        response.status(400).send(&quot;Send it using post request&quot;);
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 === &quot;&quot; || fromUid === &quot;&quot; || fcm === &quot;&quot;) {
16        response.status(400).send(&quot;Parameter is missing!&quot;);
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        &quot;apns-collapse-id&quot;: 'toUid'
31      },
32      payload: {
33        aps: {
34          sound: 'default'
35        },
36        &quot;data&quot;: {
37          &quot;fromUid&quot;: fromUid,
38          &quot;type&quot;: 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(&quot;Done&quot;);
54    } catch(e) {
55      console.log('Error sending message:', e);
56    }
57});
58         AF.request(&quot;https://myproject.net/sendNotification&quot;, method: .post, parameters: parameters, encoding: JSONEncoding.default)
59         .responseString { response in
60             print(response)
61            DispatchQueue.main.async {
62                completion(&quot;done&quot;)
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:40

I'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) =&gt; {
2
3    if (request.method !== &quot;POST&quot;) {
4        response.status(400).send(&quot;Send it using post request&quot;);
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 === &quot;&quot; || fromUid === &quot;&quot; || fcm === &quot;&quot;) {
16        response.status(400).send(&quot;Parameter is missing!&quot;);
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        &quot;apns-collapse-id&quot;: 'toUid'
31      },
32      payload: {
33        aps: {
34          sound: 'default'
35        },
36        &quot;data&quot;: {
37          &quot;fromUid&quot;: fromUid,
38          &quot;type&quot;: 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(&quot;Done&quot;);
54    } catch(e) {
55      console.log('Error sending message:', e);
56    }
57});
58         AF.request(&quot;https://myproject.net/sendNotification&quot;, method: .post, parameters: parameters, encoding: JSONEncoding.default)
59         .responseString { response in
60             print(response)
61            DispatchQueue.main.async {
62                completion(&quot;done&quot;)
63            }
64         }
65exports.onMessageCreate = functions.database
66.ref('/users/{userId}/notifications/unread/{notificationId}')
67.onCreate(async (snapshot, context) =&gt; {
68    
69    const message = snapshot.val()
70    const category = message.category
71    const title = category + &quot;: &quot; + 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) =&gt; {
99        console.log('Successfully sent notification:', response)
100    })
101    .catch((error) =&gt; {
102        console.log('Error sending notification:', error)
103    })
104    
105})
106

Source https://stackoverflow.com/questions/68199189

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:38

Google AdMob now shows below warning.

enter image description here

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

  1. Updated GoogleMobileAds SDK to 8.0

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

info.plist screenshot enter image description here

Also added App Tracking Transparancy Alert:

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. enter image description here

Data Used to Track You ( Identifiers), Data Linked to You ( Identifiers ). Is it right settings for Google AdMob ? enter image description here

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:37

Updates: 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&lt;key&gt;SKAdNetworkItems&lt;/key&gt;
25  &lt;array&gt;
26    &lt;dict&gt;
27      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
28      &lt;string&gt;cstr6suwn9.skadnetwork&lt;/string&gt;
29    &lt;/dict&gt;
30    &lt;dict&gt;
31      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
32      &lt;string&gt;4fzdc2evr5.skadnetwork&lt;/string&gt;
33    &lt;/dict&gt;
34    &lt;dict&gt;
35      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
36      &lt;string&gt;2fnua5tdw4.skadnetwork&lt;/string&gt;
37    &lt;/dict&gt;
38    &lt;dict&gt;
39      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
40      &lt;string&gt;ydx93a7ass.skadnetwork&lt;/string&gt;
41    &lt;/dict&gt;
42    &lt;dict&gt;
43      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
44      &lt;string&gt;5a6flpkh64.skadnetwork&lt;/string&gt;
45    &lt;/dict&gt;
46    &lt;dict&gt;
47      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
48      &lt;string&gt;p78axxw29g.skadnetwork&lt;/string&gt;
49    &lt;/dict&gt;
50    &lt;dict&gt;
51      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
52      &lt;string&gt;v72qych5uu.skadnetwork&lt;/string&gt;
53    &lt;/dict&gt;
54    &lt;dict&gt;
55      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
56      &lt;string&gt;c6k4g5qg8m.skadnetwork&lt;/string&gt;
57    &lt;/dict&gt;
58    &lt;dict&gt;
59      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
60      &lt;string&gt;s39g8k73mm.skadnetwork&lt;/string&gt;
61    &lt;/dict&gt;
62    &lt;dict&gt;
63      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
64      &lt;string&gt;3qy4746246.skadnetwork&lt;/string&gt;
65    &lt;/dict&gt;
66    &lt;dict&gt;
67      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
68      &lt;string&gt;3sh42y64q3.skadnetwork&lt;/string&gt;
69    &lt;/dict&gt;
70    &lt;dict&gt;
71      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
72      &lt;string&gt;f38h382jlk.skadnetwork&lt;/string&gt;
73    &lt;/dict&gt;
74    &lt;dict&gt;
75      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
76      &lt;string&gt;hs6bdukanm.skadnetwork&lt;/string&gt;
77    &lt;/dict&gt;
78    &lt;dict&gt;
79      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
80      &lt;string&gt;prcb7njmu6.skadnetwork&lt;/string&gt;
81    &lt;/dict&gt;
82    &lt;dict&gt;
83      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
84      &lt;string&gt;wzmmz9fp6w.skadnetwork&lt;/string&gt;
85    &lt;/dict&gt;
86    &lt;dict&gt;
87      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
88      &lt;string&gt;yclnxrl5pm.skadnetwork&lt;/string&gt;
89    &lt;/dict&gt;
90    &lt;dict&gt;
91      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
92      &lt;string&gt;4468km3ulz.skadnetwork&lt;/string&gt;
93    &lt;/dict&gt;
94    &lt;dict&gt;
95      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
96      &lt;string&gt;t38b2kh725.skadnetwork&lt;/string&gt;
97    &lt;/dict&gt;
98    &lt;dict&gt;
99      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
100      &lt;string&gt;7ug5zh24hu.skadnetwork&lt;/string&gt;
101    &lt;/dict&gt;
102    &lt;dict&gt;
103      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
104      &lt;string&gt;9rd848q2bz.skadnetwork&lt;/string&gt;
105    &lt;/dict&gt;
106    &lt;dict&gt;
107      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
108      &lt;string&gt;n6fk4nfna4.skadnetwork&lt;/string&gt;
109    &lt;/dict&gt;
110    &lt;dict&gt;
111      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
112      &lt;string&gt;kbd757ywx3.skadnetwork&lt;/string&gt;
113    &lt;/dict&gt;
114    &lt;dict&gt;
115      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
116      &lt;string&gt;9t245vhmpl.skadnetwork&lt;/string&gt;
117    &lt;/dict&gt;
118    &lt;dict&gt;
119      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
120      &lt;string&gt;2u9pt9hc89.skadnetwork&lt;/string&gt;
121    &lt;/dict&gt;
122    &lt;dict&gt;
123      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
124      &lt;string&gt;8s468mfl3y.skadnetwork&lt;/string&gt;
125    &lt;/dict&gt;
126    &lt;dict&gt;
127      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
128      &lt;string&gt;av6w8kgt66.skadnetwork&lt;/string&gt;
129    &lt;/dict&gt;
130    &lt;dict&gt;
131      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
132      &lt;string&gt;klf5c3l5u5.skadnetwork&lt;/string&gt;
133    &lt;/dict&gt;
134    &lt;dict&gt;
135      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
136      &lt;string&gt;ppxm28t8ap.skadnetwork&lt;/string&gt;
137    &lt;/dict&gt;
138    &lt;dict&gt;
139      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
140      &lt;string&gt;424m5254lk.skadnetwork&lt;/string&gt;
141    &lt;/dict&gt;
142    &lt;dict&gt;
143      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
144      &lt;string&gt;uw77j35x4d.skadnetwork&lt;/string&gt;
145    &lt;/dict&gt;
146    &lt;dict&gt;
147      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
148      &lt;string&gt;e5fvkxwrpn.skadnetwork&lt;/string&gt;
149    &lt;/dict&gt;
150    &lt;dict&gt;
151      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
152      &lt;string&gt;zq492l623r.skadnetwork&lt;/string&gt;
153    &lt;/dict&gt;
154    &lt;dict&gt;
155      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
156      &lt;string&gt;3qcr597p9d.skadnetwork&lt;/string&gt;
157    &lt;/dict&gt;
158  &lt;/array&gt;
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&lt;key&gt;SKAdNetworkItems&lt;/key&gt;
25  &lt;array&gt;
26    &lt;dict&gt;
27      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
28      &lt;string&gt;cstr6suwn9.skadnetwork&lt;/string&gt;
29    &lt;/dict&gt;
30    &lt;dict&gt;
31      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
32      &lt;string&gt;4fzdc2evr5.skadnetwork&lt;/string&gt;
33    &lt;/dict&gt;
34    &lt;dict&gt;
35      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
36      &lt;string&gt;2fnua5tdw4.skadnetwork&lt;/string&gt;
37    &lt;/dict&gt;
38    &lt;dict&gt;
39      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
40      &lt;string&gt;ydx93a7ass.skadnetwork&lt;/string&gt;
41    &lt;/dict&gt;
42    &lt;dict&gt;
43      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
44      &lt;string&gt;5a6flpkh64.skadnetwork&lt;/string&gt;
45    &lt;/dict&gt;
46    &lt;dict&gt;
47      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
48      &lt;string&gt;p78axxw29g.skadnetwork&lt;/string&gt;
49    &lt;/dict&gt;
50    &lt;dict&gt;
51      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
52      &lt;string&gt;v72qych5uu.skadnetwork&lt;/string&gt;
53    &lt;/dict&gt;
54    &lt;dict&gt;
55      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
56      &lt;string&gt;c6k4g5qg8m.skadnetwork&lt;/string&gt;
57    &lt;/dict&gt;
58    &lt;dict&gt;
59      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
60      &lt;string&gt;s39g8k73mm.skadnetwork&lt;/string&gt;
61    &lt;/dict&gt;
62    &lt;dict&gt;
63      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
64      &lt;string&gt;3qy4746246.skadnetwork&lt;/string&gt;
65    &lt;/dict&gt;
66    &lt;dict&gt;
67      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
68      &lt;string&gt;3sh42y64q3.skadnetwork&lt;/string&gt;
69    &lt;/dict&gt;
70    &lt;dict&gt;
71      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
72      &lt;string&gt;f38h382jlk.skadnetwork&lt;/string&gt;
73    &lt;/dict&gt;
74    &lt;dict&gt;
75      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
76      &lt;string&gt;hs6bdukanm.skadnetwork&lt;/string&gt;
77    &lt;/dict&gt;
78    &lt;dict&gt;
79      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
80      &lt;string&gt;prcb7njmu6.skadnetwork&lt;/string&gt;
81    &lt;/dict&gt;
82    &lt;dict&gt;
83      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
84      &lt;string&gt;wzmmz9fp6w.skadnetwork&lt;/string&gt;
85    &lt;/dict&gt;
86    &lt;dict&gt;
87      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
88      &lt;string&gt;yclnxrl5pm.skadnetwork&lt;/string&gt;
89    &lt;/dict&gt;
90    &lt;dict&gt;
91      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
92      &lt;string&gt;4468km3ulz.skadnetwork&lt;/string&gt;
93    &lt;/dict&gt;
94    &lt;dict&gt;
95      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
96      &lt;string&gt;t38b2kh725.skadnetwork&lt;/string&gt;
97    &lt;/dict&gt;
98    &lt;dict&gt;
99      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
100      &lt;string&gt;7ug5zh24hu.skadnetwork&lt;/string&gt;
101    &lt;/dict&gt;
102    &lt;dict&gt;
103      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
104      &lt;string&gt;9rd848q2bz.skadnetwork&lt;/string&gt;
105    &lt;/dict&gt;
106    &lt;dict&gt;
107      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
108      &lt;string&gt;n6fk4nfna4.skadnetwork&lt;/string&gt;
109    &lt;/dict&gt;
110    &lt;dict&gt;
111      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
112      &lt;string&gt;kbd757ywx3.skadnetwork&lt;/string&gt;
113    &lt;/dict&gt;
114    &lt;dict&gt;
115      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
116      &lt;string&gt;9t245vhmpl.skadnetwork&lt;/string&gt;
117    &lt;/dict&gt;
118    &lt;dict&gt;
119      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
120      &lt;string&gt;2u9pt9hc89.skadnetwork&lt;/string&gt;
121    &lt;/dict&gt;
122    &lt;dict&gt;
123      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
124      &lt;string&gt;8s468mfl3y.skadnetwork&lt;/string&gt;
125    &lt;/dict&gt;
126    &lt;dict&gt;
127      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
128      &lt;string&gt;av6w8kgt66.skadnetwork&lt;/string&gt;
129    &lt;/dict&gt;
130    &lt;dict&gt;
131      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
132      &lt;string&gt;klf5c3l5u5.skadnetwork&lt;/string&gt;
133    &lt;/dict&gt;
134    &lt;dict&gt;
135      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
136      &lt;string&gt;ppxm28t8ap.skadnetwork&lt;/string&gt;
137    &lt;/dict&gt;
138    &lt;dict&gt;
139      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
140      &lt;string&gt;424m5254lk.skadnetwork&lt;/string&gt;
141    &lt;/dict&gt;
142    &lt;dict&gt;
143      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
144      &lt;string&gt;uw77j35x4d.skadnetwork&lt;/string&gt;
145    &lt;/dict&gt;
146    &lt;dict&gt;
147      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
148      &lt;string&gt;e5fvkxwrpn.skadnetwork&lt;/string&gt;
149    &lt;/dict&gt;
150    &lt;dict&gt;
151      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
152      &lt;string&gt;zq492l623r.skadnetwork&lt;/string&gt;
153    &lt;/dict&gt;
154    &lt;dict&gt;
155      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
156      &lt;string&gt;3qcr597p9d.skadnetwork&lt;/string&gt;
157    &lt;/dict&gt;
158  &lt;/array&gt;
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&lt;key&gt;SKAdNetworkItems&lt;/key&gt;
25  &lt;array&gt;
26    &lt;dict&gt;
27      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
28      &lt;string&gt;cstr6suwn9.skadnetwork&lt;/string&gt;
29    &lt;/dict&gt;
30    &lt;dict&gt;
31      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
32      &lt;string&gt;4fzdc2evr5.skadnetwork&lt;/string&gt;
33    &lt;/dict&gt;
34    &lt;dict&gt;
35      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
36      &lt;string&gt;2fnua5tdw4.skadnetwork&lt;/string&gt;
37    &lt;/dict&gt;
38    &lt;dict&gt;
39      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
40      &lt;string&gt;ydx93a7ass.skadnetwork&lt;/string&gt;
41    &lt;/dict&gt;
42    &lt;dict&gt;
43      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
44      &lt;string&gt;5a6flpkh64.skadnetwork&lt;/string&gt;
45    &lt;/dict&gt;
46    &lt;dict&gt;
47      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
48      &lt;string&gt;p78axxw29g.skadnetwork&lt;/string&gt;
49    &lt;/dict&gt;
50    &lt;dict&gt;
51      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
52      &lt;string&gt;v72qych5uu.skadnetwork&lt;/string&gt;
53    &lt;/dict&gt;
54    &lt;dict&gt;
55      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
56      &lt;string&gt;c6k4g5qg8m.skadnetwork&lt;/string&gt;
57    &lt;/dict&gt;
58    &lt;dict&gt;
59      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
60      &lt;string&gt;s39g8k73mm.skadnetwork&lt;/string&gt;
61    &lt;/dict&gt;
62    &lt;dict&gt;
63      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
64      &lt;string&gt;3qy4746246.skadnetwork&lt;/string&gt;
65    &lt;/dict&gt;
66    &lt;dict&gt;
67      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
68      &lt;string&gt;3sh42y64q3.skadnetwork&lt;/string&gt;
69    &lt;/dict&gt;
70    &lt;dict&gt;
71      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
72      &lt;string&gt;f38h382jlk.skadnetwork&lt;/string&gt;
73    &lt;/dict&gt;
74    &lt;dict&gt;
75      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
76      &lt;string&gt;hs6bdukanm.skadnetwork&lt;/string&gt;
77    &lt;/dict&gt;
78    &lt;dict&gt;
79      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
80      &lt;string&gt;prcb7njmu6.skadnetwork&lt;/string&gt;
81    &lt;/dict&gt;
82    &lt;dict&gt;
83      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
84      &lt;string&gt;wzmmz9fp6w.skadnetwork&lt;/string&gt;
85    &lt;/dict&gt;
86    &lt;dict&gt;
87      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
88      &lt;string&gt;yclnxrl5pm.skadnetwork&lt;/string&gt;
89    &lt;/dict&gt;
90    &lt;dict&gt;
91      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
92      &lt;string&gt;4468km3ulz.skadnetwork&lt;/string&gt;
93    &lt;/dict&gt;
94    &lt;dict&gt;
95      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
96      &lt;string&gt;t38b2kh725.skadnetwork&lt;/string&gt;
97    &lt;/dict&gt;
98    &lt;dict&gt;
99      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
100      &lt;string&gt;7ug5zh24hu.skadnetwork&lt;/string&gt;
101    &lt;/dict&gt;
102    &lt;dict&gt;
103      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
104      &lt;string&gt;9rd848q2bz.skadnetwork&lt;/string&gt;
105    &lt;/dict&gt;
106    &lt;dict&gt;
107      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
108      &lt;string&gt;n6fk4nfna4.skadnetwork&lt;/string&gt;
109    &lt;/dict&gt;
110    &lt;dict&gt;
111      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
112      &lt;string&gt;kbd757ywx3.skadnetwork&lt;/string&gt;
113    &lt;/dict&gt;
114    &lt;dict&gt;
115      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
116      &lt;string&gt;9t245vhmpl.skadnetwork&lt;/string&gt;
117    &lt;/dict&gt;
118    &lt;dict&gt;
119      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
120      &lt;string&gt;2u9pt9hc89.skadnetwork&lt;/string&gt;
121    &lt;/dict&gt;
122    &lt;dict&gt;
123      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
124      &lt;string&gt;8s468mfl3y.skadnetwork&lt;/string&gt;
125    &lt;/dict&gt;
126    &lt;dict&gt;
127      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
128      &lt;string&gt;av6w8kgt66.skadnetwork&lt;/string&gt;
129    &lt;/dict&gt;
130    &lt;dict&gt;
131      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
132      &lt;string&gt;klf5c3l5u5.skadnetwork&lt;/string&gt;
133    &lt;/dict&gt;
134    &lt;dict&gt;
135      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
136      &lt;string&gt;ppxm28t8ap.skadnetwork&lt;/string&gt;
137    &lt;/dict&gt;
138    &lt;dict&gt;
139      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
140      &lt;string&gt;424m5254lk.skadnetwork&lt;/string&gt;
141    &lt;/dict&gt;
142    &lt;dict&gt;
143      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
144      &lt;string&gt;uw77j35x4d.skadnetwork&lt;/string&gt;
145    &lt;/dict&gt;
146    &lt;dict&gt;
147      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
148      &lt;string&gt;e5fvkxwrpn.skadnetwork&lt;/string&gt;
149    &lt;/dict&gt;
150    &lt;dict&gt;
151      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
152      &lt;string&gt;zq492l623r.skadnetwork&lt;/string&gt;
153    &lt;/dict&gt;
154    &lt;dict&gt;
155      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
156      &lt;string&gt;3qcr597p9d.skadnetwork&lt;/string&gt;
157    &lt;/dict&gt;
158  &lt;/array&gt;
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&lt;key&gt;SKAdNetworkItems&lt;/key&gt;
25  &lt;array&gt;
26    &lt;dict&gt;
27      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
28      &lt;string&gt;cstr6suwn9.skadnetwork&lt;/string&gt;
29    &lt;/dict&gt;
30    &lt;dict&gt;
31      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
32      &lt;string&gt;4fzdc2evr5.skadnetwork&lt;/string&gt;
33    &lt;/dict&gt;
34    &lt;dict&gt;
35      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
36      &lt;string&gt;2fnua5tdw4.skadnetwork&lt;/string&gt;
37    &lt;/dict&gt;
38    &lt;dict&gt;
39      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
40      &lt;string&gt;ydx93a7ass.skadnetwork&lt;/string&gt;
41    &lt;/dict&gt;
42    &lt;dict&gt;
43      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
44      &lt;string&gt;5a6flpkh64.skadnetwork&lt;/string&gt;
45    &lt;/dict&gt;
46    &lt;dict&gt;
47      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
48      &lt;string&gt;p78axxw29g.skadnetwork&lt;/string&gt;
49    &lt;/dict&gt;
50    &lt;dict&gt;
51      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
52      &lt;string&gt;v72qych5uu.skadnetwork&lt;/string&gt;
53    &lt;/dict&gt;
54    &lt;dict&gt;
55      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
56      &lt;string&gt;c6k4g5qg8m.skadnetwork&lt;/string&gt;
57    &lt;/dict&gt;
58    &lt;dict&gt;
59      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
60      &lt;string&gt;s39g8k73mm.skadnetwork&lt;/string&gt;
61    &lt;/dict&gt;
62    &lt;dict&gt;
63      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
64      &lt;string&gt;3qy4746246.skadnetwork&lt;/string&gt;
65    &lt;/dict&gt;
66    &lt;dict&gt;
67      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
68      &lt;string&gt;3sh42y64q3.skadnetwork&lt;/string&gt;
69    &lt;/dict&gt;
70    &lt;dict&gt;
71      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
72      &lt;string&gt;f38h382jlk.skadnetwork&lt;/string&gt;
73    &lt;/dict&gt;
74    &lt;dict&gt;
75      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
76      &lt;string&gt;hs6bdukanm.skadnetwork&lt;/string&gt;
77    &lt;/dict&gt;
78    &lt;dict&gt;
79      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
80      &lt;string&gt;prcb7njmu6.skadnetwork&lt;/string&gt;
81    &lt;/dict&gt;
82    &lt;dict&gt;
83      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
84      &lt;string&gt;wzmmz9fp6w.skadnetwork&lt;/string&gt;
85    &lt;/dict&gt;
86    &lt;dict&gt;
87      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
88      &lt;string&gt;yclnxrl5pm.skadnetwork&lt;/string&gt;
89    &lt;/dict&gt;
90    &lt;dict&gt;
91      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
92      &lt;string&gt;4468km3ulz.skadnetwork&lt;/string&gt;
93    &lt;/dict&gt;
94    &lt;dict&gt;
95      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
96      &lt;string&gt;t38b2kh725.skadnetwork&lt;/string&gt;
97    &lt;/dict&gt;
98    &lt;dict&gt;
99      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
100      &lt;string&gt;7ug5zh24hu.skadnetwork&lt;/string&gt;
101    &lt;/dict&gt;
102    &lt;dict&gt;
103      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
104      &lt;string&gt;9rd848q2bz.skadnetwork&lt;/string&gt;
105    &lt;/dict&gt;
106    &lt;dict&gt;
107      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
108      &lt;string&gt;n6fk4nfna4.skadnetwork&lt;/string&gt;
109    &lt;/dict&gt;
110    &lt;dict&gt;
111      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
112      &lt;string&gt;kbd757ywx3.skadnetwork&lt;/string&gt;
113    &lt;/dict&gt;
114    &lt;dict&gt;
115      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
116      &lt;string&gt;9t245vhmpl.skadnetwork&lt;/string&gt;
117    &lt;/dict&gt;
118    &lt;dict&gt;
119      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
120      &lt;string&gt;2u9pt9hc89.skadnetwork&lt;/string&gt;
121    &lt;/dict&gt;
122    &lt;dict&gt;
123      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
124      &lt;string&gt;8s468mfl3y.skadnetwork&lt;/string&gt;
125    &lt;/dict&gt;
126    &lt;dict&gt;
127      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
128      &lt;string&gt;av6w8kgt66.skadnetwork&lt;/string&gt;
129    &lt;/dict&gt;
130    &lt;dict&gt;
131      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
132      &lt;string&gt;klf5c3l5u5.skadnetwork&lt;/string&gt;
133    &lt;/dict&gt;
134    &lt;dict&gt;
135      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
136      &lt;string&gt;ppxm28t8ap.skadnetwork&lt;/string&gt;
137    &lt;/dict&gt;
138    &lt;dict&gt;
139      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
140      &lt;string&gt;424m5254lk.skadnetwork&lt;/string&gt;
141    &lt;/dict&gt;
142    &lt;dict&gt;
143      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
144      &lt;string&gt;uw77j35x4d.skadnetwork&lt;/string&gt;
145    &lt;/dict&gt;
146    &lt;dict&gt;
147      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
148      &lt;string&gt;e5fvkxwrpn.skadnetwork&lt;/string&gt;
149    &lt;/dict&gt;
150    &lt;dict&gt;
151      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
152      &lt;string&gt;zq492l623r.skadnetwork&lt;/string&gt;
153    &lt;/dict&gt;
154    &lt;dict&gt;
155      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
156      &lt;string&gt;3qcr597p9d.skadnetwork&lt;/string&gt;
157    &lt;/dict&gt;
158  &lt;/array&gt;
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&lt;key&gt;NSUserTrackingUsageDescription&lt;/key&gt;
188&lt;string&gt;This identifier will be used to deliver personalized ads to you.&lt;/string&gt;
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&lt;key&gt;SKAdNetworkItems&lt;/key&gt;
25  &lt;array&gt;
26    &lt;dict&gt;
27      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
28      &lt;string&gt;cstr6suwn9.skadnetwork&lt;/string&gt;
29    &lt;/dict&gt;
30    &lt;dict&gt;
31      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
32      &lt;string&gt;4fzdc2evr5.skadnetwork&lt;/string&gt;
33    &lt;/dict&gt;
34    &lt;dict&gt;
35      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
36      &lt;string&gt;2fnua5tdw4.skadnetwork&lt;/string&gt;
37    &lt;/dict&gt;
38    &lt;dict&gt;
39      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
40      &lt;string&gt;ydx93a7ass.skadnetwork&lt;/string&gt;
41    &lt;/dict&gt;
42    &lt;dict&gt;
43      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
44      &lt;string&gt;5a6flpkh64.skadnetwork&lt;/string&gt;
45    &lt;/dict&gt;
46    &lt;dict&gt;
47      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
48      &lt;string&gt;p78axxw29g.skadnetwork&lt;/string&gt;
49    &lt;/dict&gt;
50    &lt;dict&gt;
51      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
52      &lt;string&gt;v72qych5uu.skadnetwork&lt;/string&gt;
53    &lt;/dict&gt;
54    &lt;dict&gt;
55      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
56      &lt;string&gt;c6k4g5qg8m.skadnetwork&lt;/string&gt;
57    &lt;/dict&gt;
58    &lt;dict&gt;
59      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
60      &lt;string&gt;s39g8k73mm.skadnetwork&lt;/string&gt;
61    &lt;/dict&gt;
62    &lt;dict&gt;
63      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
64      &lt;string&gt;3qy4746246.skadnetwork&lt;/string&gt;
65    &lt;/dict&gt;
66    &lt;dict&gt;
67      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
68      &lt;string&gt;3sh42y64q3.skadnetwork&lt;/string&gt;
69    &lt;/dict&gt;
70    &lt;dict&gt;
71      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
72      &lt;string&gt;f38h382jlk.skadnetwork&lt;/string&gt;
73    &lt;/dict&gt;
74    &lt;dict&gt;
75      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
76      &lt;string&gt;hs6bdukanm.skadnetwork&lt;/string&gt;
77    &lt;/dict&gt;
78    &lt;dict&gt;
79      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
80      &lt;string&gt;prcb7njmu6.skadnetwork&lt;/string&gt;
81    &lt;/dict&gt;
82    &lt;dict&gt;
83      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
84      &lt;string&gt;wzmmz9fp6w.skadnetwork&lt;/string&gt;
85    &lt;/dict&gt;
86    &lt;dict&gt;
87      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
88      &lt;string&gt;yclnxrl5pm.skadnetwork&lt;/string&gt;
89    &lt;/dict&gt;
90    &lt;dict&gt;
91      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
92      &lt;string&gt;4468km3ulz.skadnetwork&lt;/string&gt;
93    &lt;/dict&gt;
94    &lt;dict&gt;
95      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
96      &lt;string&gt;t38b2kh725.skadnetwork&lt;/string&gt;
97    &lt;/dict&gt;
98    &lt;dict&gt;
99      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
100      &lt;string&gt;7ug5zh24hu.skadnetwork&lt;/string&gt;
101    &lt;/dict&gt;
102    &lt;dict&gt;
103      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
104      &lt;string&gt;9rd848q2bz.skadnetwork&lt;/string&gt;
105    &lt;/dict&gt;
106    &lt;dict&gt;
107      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
108      &lt;string&gt;n6fk4nfna4.skadnetwork&lt;/string&gt;
109    &lt;/dict&gt;
110    &lt;dict&gt;
111      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
112      &lt;string&gt;kbd757ywx3.skadnetwork&lt;/string&gt;
113    &lt;/dict&gt;
114    &lt;dict&gt;
115      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
116      &lt;string&gt;9t245vhmpl.skadnetwork&lt;/string&gt;
117    &lt;/dict&gt;
118    &lt;dict&gt;
119      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
120      &lt;string&gt;2u9pt9hc89.skadnetwork&lt;/string&gt;
121    &lt;/dict&gt;
122    &lt;dict&gt;
123      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
124      &lt;string&gt;8s468mfl3y.skadnetwork&lt;/string&gt;
125    &lt;/dict&gt;
126    &lt;dict&gt;
127      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
128      &lt;string&gt;av6w8kgt66.skadnetwork&lt;/string&gt;
129    &lt;/dict&gt;
130    &lt;dict&gt;
131      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
132      &lt;string&gt;klf5c3l5u5.skadnetwork&lt;/string&gt;
133    &lt;/dict&gt;
134    &lt;dict&gt;
135      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
136      &lt;string&gt;ppxm28t8ap.skadnetwork&lt;/string&gt;
137    &lt;/dict&gt;
138    &lt;dict&gt;
139      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
140      &lt;string&gt;424m5254lk.skadnetwork&lt;/string&gt;
141    &lt;/dict&gt;
142    &lt;dict&gt;
143      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
144      &lt;string&gt;uw77j35x4d.skadnetwork&lt;/string&gt;
145    &lt;/dict&gt;
146    &lt;dict&gt;
147      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
148      &lt;string&gt;e5fvkxwrpn.skadnetwork&lt;/string&gt;
149    &lt;/dict&gt;
150    &lt;dict&gt;
151      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
152      &lt;string&gt;zq492l623r.skadnetwork&lt;/string&gt;
153    &lt;/dict&gt;
154    &lt;dict&gt;
155      &lt;key&gt;SKAdNetworkIdentifier&lt;/key&gt;
156      &lt;string&gt;3qcr597p9d.skadnetwork&lt;/string&gt;
157    &lt;/dict&gt;
158  &lt;/array&gt;
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&lt;key&gt;NSUserTrackingUsageDescription&lt;/key&gt;
188&lt;string&gt;This identifier will be used to deliver personalized ads to you.&lt;/string&gt;
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(@&quot;Failed to load app open ad: %@&quot;, 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(@&quot;\nAdmob Failed to load interstitial ad with error: %@&quot;, [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

Source https://stackoverflow.com/questions/66177136

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Messaging

Tutorials and Learning Resources are not available at this moment for Messaging

Share this Page

share link

Get latest updates on Messaging