React native has its own default back button.

How can I add InterstitialAd in React Native, when I press React native back button from a page or if I exit the page(Not exiting the App) by pressing the Home button in Bottom Tabs Navigator bar.

I have added my Home button in Tabbar. so that a user directly clicks Home button from a particular page.

This is the page where I have added InterstitialAd

import React, { useState, useEffect } from "react"; import { View, Button, Text, ScrollView, } from 'react-native'; import { AppOpenAd, InterstitialAd, RewardedAd, BannerAd, TestIds, AdEventType } from 'react-native-google-mobile-ads'; const TestAds = ({ navigation }) => { useEffect(() => {         let interstitial = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, {             requestNonPersonalizedAdsOnly: true,             keywords: ['fashion', 'clothing'],         });         interstitial.addAdEventListener(AdEventType.LOADED, () => {             interstitial.show();         });         interstitial.load();         return () => {             interstitialListener = null;         };     }, []); return (         <ScrollView>             <View>                 <View style={{ marginTop: 20 }}>                     <Text>                         Lorem Ipsum is simply dummy text of the printing and typesetting industry.                         Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </Text>                 </View>             </View>         </ScrollView>     ) } export default TestAds 

My App.js file

import * as React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Contact from './Contact'; import Test from './Test'; import TestAds from './TestAds'; const Tab = createBottomTabNavigator(); const HomeTabs = ({ navigation }) =>{   return (     <Tab.Navigator screenOptions={{ headerShown: false }}>       <Tab.Screen name="Contact" component={Contact} />       <Tab.Screen name="Test" component={Test} />      </Tab.Navigator>   ); } const Stack = createNativeStackNavigator(); export default function App () {   return (     <NavigationContainer>       <Stack.Navigator>         <Stack.Screen name="Home" component={HomeTabs} />         <Tab.Screen name="TestAds" component={TestAds} />       </Stack.Navigator>     </NavigationContainer>   ); } 

I got this error- TypeError: undefined is not a function (near '...interstitial.onAdEvent...')

I am using- npm i react-native-google-mobile-ads

Thank you in advance for your support.

import React, { useState, useEffect } from "react"; import { View, Button, Text, ScrollView, } from 'react-native'; import { AppOpenAd, InterstitialAd, RewardedAd, BannerAd, TestIds, AdEventType } from 'react-native-google-mobile-ads'; const TestAds = ({ navigation }) => {   useEffect(() => {       let  interstitial = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, {          requestNonPersonalizedAdsOnly: true,         keywords: ['fashion', 'clothing'],       });       let interstitialListener = interstitial.onAdEvent(type => {         if (type === AdEventType.LOADED){             interstitial.show();         }       });       interstitial.load();       return()=>{         interstitialListener=null;       };   }, []);     return (     <ScrollView>         <View>             <View style={{ marginTop: 20 }}>                 <Text>                     Lorem Ipsum is simply dummy text of the printing and typesetting industry.                     Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,                 </Text>             </View>         </View>     </ScrollView>   ) } export default TestAds 

The below code is working please check if I still missed anything else

useEffect(() => {     let interstitial = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL, {         requestNonPersonalizedAdsOnly: true,         keywords: ['fashion', 'clothing'],     });     interstitial.addAdEventListener(AdEventType.LOADED, () => {         interstitial.show();     });     interstitial.load();     return () => {         interstitialListener = null;     }; }, []); 

I’m building a custom Zap to integrate Google Local Service Ads API with our CRM. It appears everything is functioning properly however, I noticed several new leads are not coming through, which appears to be due to the API request sending nested data using the values nested under the same field .

Here is an example response:

    {     "leadId": "000000000",     "accountId": "000000000",     "businessName": "Acme, Inc",     "leadCreationTimestamp": "2022-08-09T16:21:14Z",     "leadType": "PHONE_CALL",     "leadCategory": "roofer",     "geo": "Miami,Florida,United States",     "phoneLead": {       "consumerPhoneNumber": "+15555555678"     },     "chargeStatus": "NOT_CHARGED",     "currencyCode": "USD",     "timezone": {       "id": "America/New_York"     },     "id": "0000000000"   },   {     "leadId": "000000000",     "accountId": "000000000",     "businessName": "Acme, Inc",     "leadCreationTimestamp": "2022-08-09T16:39:38Z",     "leadType": "MESSAGE",     "leadCategory": "roofer",     "geo": "Miami,Florida,United States",     "messageLead": {       "customerName": "Jane Doe",       "jobType": "attic_venting",       "postalCode": "33066",       "consumerPhoneNumber": "+15555555789"     },     "chargeStatus": "CHARGED",     "currencyCode": "USD",     "timezone": {       "id": "America/New_York"     },     "id": "1111111111"   },   {     "leadId": "000000000",     "accountId": "000000000",     "businessName": "Acme, Inc",     "leadCreationTimestamp": "2022-08-10T19:12:28Z",     "leadType": "PHONE_CALL",     "leadCategory": "window_repair",     "geo": "Miami,Florida,United States",     "phoneLead": {       "chargedCallTimestamp": "2022-08-10T19:12:28Z",       "chargedConnectedCallDurationSeconds": "280s",       "consumerPhoneNumber": "+15555555890"     },     "chargeStatus": "CHARGED",     "currencyCode": "USD",     "timezone": {       "id": "America/New_York"     },     "id": "2222222222"   }, 

The issue I’m running into is when mapping the data to our CRM, the trigger test data is providing multiple fields for ‘consumerPhoneNumber’ ( based on whether it is a message/phone lead and whether the call connected ). so we are unable to map phoneLead__consumerPhoneNumber and messageLead___consumerPhoneNumber to the same field.

duplicate fields example

How can I parse the API response to properly map the consumerPhoneNumber when the value changes based on messageLead_consumerPhoneNumber versus phoneLead_consumerPhoneNumber?

I understand some basic Javascript but parsing API data is new to me. Any help would be truly appreciated!

Here is the JavaScript code for our API request.

    const options = {   url: 'https://localservices.googleapis.com/v1/detailedLeadReports:search',   method: 'GET',   headers: {     'Authorization': `Bearer ${bundle.authData.access_token}`,     'X-QUERY': bundle.authData.query   },   params: {     'query': 'manager_customer_id:XXXXXXXXX',     'pageSize': '1000'   } } return z.request(options).then((response) => {   response.throwForStatus();   const results = response.json;   const lists = results["detailedLeadReports"].map((item) => {     return Object.assign(item, {       id: item["leadId"],     });   });   return lists; }); 

I'm trying to send a POST request to edit a template message of WhatsApp:

POST /{whatsapp_template_id}    {   "name": "my_template",   "language": "en_US",   "category": "transactional",   "components": [     {       "type": "BODY",       "text": "whatsapp buddy?"     }   ] } 

Receiving (#3) Application does not have the capability to make this API call.

Does Boto3 client support connectors for GoogleAds and FacebookAds? According to documentation we can use Custom Connector but when i try to use it in the code i get the below error saying it should be one of the built in types.

[ERROR] ParamValidationError: Parameter validation failed: Unknown parameter in connectorProfileConfig.connectorProfileProperties: "CustomConnector", must be one of: Amplitude, Datadog, Dynatrace, GoogleAnalytics, Honeycode, InforNexus, Marketo, Redshift, Salesforce, ServiceNow, Singular, Slack, Snowflake, Trendmicro, Veeva, Zendesk, SAPOData Unknown parameter in connectorProfileConfig.connectorProfileCredentials: "CustomConnector", must be one of: Amplitude, Datadog, Dynatrace, GoogleAnalytics, Honeycode, InforNexus, Marketo, Redshift, Salesforce, ServiceNow, Singular, Slack, Snowflake, Trendmicro, Veeva, Zendesk, SAPOData Traceback (most recent call last):   File "/var/task/lambda_function.py", line 34, in lambda_handler     response = client.create_connector_profile(   File "/var/runtime/botocore/client.py", line 391, in _api_call     return self._make_api_call(operation_name, kwargs)   File "/var/runtime/botocore/client.py", line 691, in _make_api_call     request_dict = self._convert_to_request_dict(   File "/var/runtime/botocore/client.py", line 739, in _convert_to_request_dict     request_dict = self._serializer.serialize_to_request(   File "/var/runtime/botocore/validate.py", line 360, in serialize_to_request     raise ParamValidationError(report=report.generate_report()) 

Code in Lambda :

import json import boto3 def lambda_handler(event, context):     client = boto3.client('appflow')        ### Google Ads     response = client.create_connector_profile(     connectorProfileName='GoogleAdsConn',     connectorType='CustomConnector',     # connectorLabel='GoogleAds',     connectionMode='Public',     connectorProfileConfig= {       "connectorProfileProperties": {           'CustomConnector': {                 # 'profileProperties': {                 #     'string': 'string'                 # },                 'oAuth2Properties': {                     'tokenUrl': 'https://oauth2.googleapis.com/token',                     'oAuth2GrantType': 'AUTHORIZATION_CODE'                     # ,'tokenUrlCustomProperties': {                     #     'string': 'string'                     # }                 }             }             },       "connectorProfileCredentials": {         "CustomConnector": {              "authenticationType": "OAUTH2",             "oauth2": {                 "accessToken": "myaccesstoken",                "clientId": "myclientid",                "clientSecret": "myclientsecret",               "oAuthRequest": {                   "authCode": "string",                  "redirectUri": "string"               },                "refreshToken": "myrefreshtoken"             }       }     }        }    )     return {         'response': response     } 

Any leads on this will be appreciated.
Thanks!