0% found this document useful (0 votes)
9 views

After Call - Development Integration Manual

Uploaded by

Anderson BM
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

After Call - Development Integration Manual

Uploaded by

Anderson BM
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Prerequisites

In the app manifest, the Admob APPLICATION_ID must appear within the
application tag; the library fetches it from there.
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>

Additionally, the following permissions must be added:


<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<uses-permission android:name="android.permission.READ_CALL_LOG"/>

<uses-permission android:name="android.permission.READ_CONTACTS"/>

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<uses-permission android:name="android.permission.INTERNET" />

Instructions
In the target application, after obtaining user permissions, you must import
these 2 references in order to work with after_call
import com.weewoo.after_call.receiver.PhoneStateReceiverAfc

import com.weewoo.after_call.ad.AdsData

Also, you need to declare a private variable of type PhoneStateReceiverAfc,


and initialize it in the onCreate method as follows:
private lateinit var phoneStateReceiver: PhoneStateReceiverAfc

override fun onCreate(savedInstanceState: Bundle?) {

super.onCreate(savedInstanceState)

setContentView(R.layout.activity_main)

//INIT OF RECEIVER

val adUnit = "ca-app-pub-3940256099942544/9214589741"

//ADSDATA CLASS SAVE UNIT ID TO SHOW THE BANNER ON AFTER CALL

AdsData.setAdsData(applicationContext, adUnit)

phoneStateReceiver = PhoneStateReceiverAfc()

var listener =
phoneStateReceiver.PhoneCallStartEndDetector(applicationContext)

val intentFilter = IntentFilter()

intentFilter.addAction(TelephonyManager.EXTRA_STATE)

registerReceiver(phoneStateReceiver, intentFilter)

val telephonyManager = getSystemService(Context.TELEPHONY_SERVICE) as


TelephonyManager
telephonyManager.listen(listener, PhoneStateListener.LISTEN_CALL_STATE)

//REST OF CODE

It's essential to respect the name "adUnit" in the intent for consistency.
The two AdMob IDs mentioned in this document are the test IDs provided by
AdMob.
If all the configuration has been done properly you should see this screen
after a call is ended:

You might also like