How does WhatsApp pop-up notification work? | Forum

Topic location: Forum home » General » General Chat
butlermosan
butlermosan Jan 2

I am trying to mimic the pop-up notification of WhatsApp from https://fmwhatdownload.pk/. (If you have not seen it, it might be a bit hard for you to understand this.)


Some suggested that this might be done using an oridnary activity which has the Theme.Holo.Light.Dialog.Alert theme. However, when I implemented that I got half of the activity full with the views (and the other half) which is supposed to be empty like a dialog, showing a white background. ie, I did not have the dialog feel.


Morever, when the device is in standby mode (power button pressed) and locked, whatsapp is able to bypass that and show the popup dialog (or activity, or whatever) above that.


Any ideas how to implement this ?

The Forum post is edited by butlermosan Feb 20
Janny Jazz
Janny Jazz Feb 2

To implement a pop-up notification similar to WhatsApp, you can use a combination of a transparent Activity and a WindowManager to create a floating view. Here's a simplified example:


1. **Create a transparent Activity:**

   Set your activity theme to a transparent one in the AndroidManifest.xml file:


   ```xml

   <activity android:name=".YourPopupActivity"

             android:theme="@android:style/Theme.Translucent.NoTitleBar">

       <!-- other activity configurations -->

   </activity>

   ```


2. **Layout for YourPopupActivity:**

   Create a layout for your popup. This could be a simple layout containing the views you want in the popup.


3. **Code for YourPopupActivity:**

   In your activity, set the layout, and adjust window parameters:


   ```java

   public class YourPopupActivity extends Activity {


       @Override

       protected void onCreate(Bundle savedInstanceState) {

           super.onCreate(savedInstanceState);

           setContentView(R.layout.your_popup_layout);


           // Adjust window parameters

           WindowManager.LayoutParams params = getWindow().getAttributes();

           params.gravity = Gravity.TOP | Gravity.START;

           params.x = 0;

           params.y = 0;

           params.width = WindowManager.LayoutParams.WRAP_CONTENT;

           params.height = WindowManager.LayoutParams.WRAP_CONTENT;


           getWindow().setAttributes(params);

       }

   }

   ```


4. **Show the Popup:**

   Wherever you want to show the popup (e.g., on a button click), start your transparent activity:


   ```java

   Intent intent = new Intent(context, YourPopupActivity.class);

   intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

   startActivity(intent);

   ```


Remember to handle permissions (e.g., SYSTEM_ALERT_WINDOW) and be cautious with floating views for a good user experience. FM WhatsApp APK


Regarding showing the popup even when the device is locked, you might need to use a combination of flags, permissions, and possibly Device Administration APIs, depending on the Android version and security settings. Keep in mind that accessing the screen while the device is locked may have security implications and may not be allowed in certain scenarios. Always consider user privacy and security when implementing such features. 

Max
Max Feb 23
[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">jobabandonment.ru[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инйо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u"> [u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">инфо[/u">[u">tuchkas[/u">[u">инфо[/u">[u">инфо[/u">
John Dolan
John Dolan Apr 17

WhatsApp's pop-up notifications work by leveraging the notification system of your device's operating system. When you receive a new message on WhatsApp, the app sends a notification to your device's operating system, whether it's iOS or Android.


The operating system then processes this notification and displays it as a pop-up on your screen, usually accompanied by a sound or vibration alert to get your attention. You can customize these settings within the WhatsApp app or through your device's settings menu to control how notifications are displayed and whether they include previews of the messages.


For more amazing features you can Download FM WhatsApp

This system allows you to stay informed about incoming messages even when you're not actively using the WhatsApp app, making it convenient to keep up with your conversations in real-time. However, it's important to be mindful of privacy settings to ensure that sensitive information isn't inadvertently displayed on your device's lock screen or in the notification preview.

Saqlain Abbas
Saqlain Abbas Jun 11

WhatsApp pop-up notifications work by leveraging the notification system of the operating system (iOS or Android). Here’s a high-level overview of the process:AN WhatsApp

  1. Push Notification Service: WhatsApp uses Apple Push Notification Service (APNS) for iOS and Firebase Cloud Messaging (FCM) for Android to send notifications to the device.

  2. Background Processing: When a message is received, WhatsApp servers send a push notification to the user's device through APNS or FCM.

  3. Notification Handling:

    • Android: The notification is handled by the Android system, which triggers the display of the pop-up based on user settings and notification channels.
    • iOS: The notification is managed by iOS, which can display banners, alerts, or badges, and includes options for temporary or persistent pop-ups.
  4. User Interaction: When the user taps on the pop-up, the WhatsApp app is opened, and the corresponding chat or message is displayed.

  5. Customization: Users can customize notification settings within the WhatsApp app and the device's notification settings to control how and when notifications appear.

This system ensures users are promptly alerted to new messages while allowing customization and control over notification behavior.

Saqlain Abbas
Saqlain Abbas Jun 13
WhatsApp pop-up notifications work by using the notification system of the device's operating system (iOS or Android). When a new message arrives, WhatsApp triggers a notification that appears as a pop-up on the screen. This pop-up shows a preview of the message, the sender's name, and provides options to reply directly, dismiss, or open the app. These notifications are managed through device settings, where users can customize their appearance, sound, vibration, and whether they appear as banners, alerts, or lock screen notifications. The implementation leverages background processes and push notification services provided by Apple and Google. Visit on my new WatchAsian.
Max
Max Aug 9
[u">бизн[/u">[u">66.3[/u">[u">Bett[/u">[u">Natu[/u">[u">Jump[/u">[u">Amel[/u">[u">Leon[/u">[u">Simo[/u">[u">Влад[/u">[u">Каме[/u">[u">Baby[/u">[u">Prov[/u">[u">Треу[/u">[u">Гого[/u">[u">ZORL[/u">[u">Emil[/u">[u">Кита[/u">[u">CONS[/u">[u">Бого[/u">[u">Elec[/u">[u">Lanc[/u">[u">Wind[/u">[u">Stas[/u">[u">Jewe[/u"> [u">Digi[/u">[u">Loun[/u">[u">Gene[/u">[u">Wind[/u">[u">Sony[/u">[u">Sedu[/u">[u">SOCO[/u">[u">Mick[/u">[u">Mika[/u">[u">(190[/u">[u">Arth[/u">[u">каче[/u">[u">Scen[/u">[u">Hype[/u">[u">игру[/u">[u">Орех[/u">[u">Mary[/u">[u">Noki[/u">[u">Mick[/u">[u">Read[/u">[u">Гуне[/u">[u">Кузь[/u">[u">серт[/u">[u">Форм[/u"> [u">Kara[/u">[u">Pete[/u">[u">Солн[/u">[u">1279[/u">[u">Spor[/u">[u">разн[/u">[u">Chri[/u">[u">XIII[/u">[u">Iron[/u">[u">Eleg[/u">[u">Morn[/u">[u">Ralp[/u">[u">Abba[/u">[u">Теат[/u">[u">Univ[/u">[u">прел[/u">[u">Wesl[/u">[u">(ист[/u">[u">Audi[/u">[u">Nigh[/u">[u">кото[/u">[u">Etni[/u">[u">Lovi[/u">[u">From[/u"> [u">Maci[/u">[u">Wind[/u">[u">Wind[/u">[u">рома[/u">[u">Wind[/u">[u">Gius[/u">[u">Wind[/u">[u">Грач[/u">[u">Ridl[/u">[u">Timo[/u">[u">Have[/u">[u">01-2[/u">[u">Разм[/u">[u">Slim[/u">[u">прес[/u">[u">рабо[/u">[u">Ruya[/u">[u">Coca[/u">[u">Bonu[/u">[u">Pedr[/u">[u">Кита[/u">[u">Slam[/u">[u">Swee[/u">[u">03-0[/u"> [u">RHTL[/u">[u">Goff[/u">[u">Walk[/u">[u">Appl[/u">[u">Tjar[/u">[u">Play[/u">[u">Kasp[/u">[u">Alex[/u">[u">Rola[/u">[u">д'Ар[/u">[u">Clif[/u">[u">Perf[/u">[u">Нови[/u">[u">Турц[/u">[u">Pock[/u">[u">Alie[/u">[u">Bonu[/u">[u">Vide[/u">[u">Iyen[/u">[u">Tere[/u">[u">поло[/u">[u">орга[/u">[u">Indu[/u">[u">клйе[/u"> [u">Sony[/u">[u">Kron[/u">[u">INTE[/u">[u">ВСМе[/u">[u">субт[/u">[u">Rudy[/u">[u">Char[/u">[u">Арти[/u">[u">Прож[/u">[u">2804[/u">[u">плас[/u">[u">1273[/u">[u">Olme[/u">[u">ARAG[/u">[u">Batt[/u">[u">поло[/u">[u">нерв[/u">[u">imag[/u">[u">Поль[/u">[u">Vali[/u">[u">пазл[/u">[u">камн[/u">[u">инст[/u">[u">Кита[/u"> [u">Кита[/u">[u">Щерб[/u">[u">Wind[/u">[u">студ[/u">[u">Addr[/u">[u">supe[/u">[u">Clor[/u">[u">серт[/u">[u">Bird[/u">[u">друг[/u">[u">Рамб[/u">[u">Hunk[/u">[u">№156[/u">[u">Bena[/u">[u">ЛитР[/u">[u">ЛитР[/u">[u">ЛитР[/u">[u">Седи[/u">[u">(183[/u">[u">Keit[/u">[u">Грин[/u">[u">Шилл[/u">[u">выну[/u">[u">Трус[/u"> [u">друг[/u">[u">сове[/u">[u">Васи[/u">[u">заво[/u">[u">Litt[/u">[u">Калу[/u">[u">филь[/u">[u">Krol[/u">[u">Копы[/u">[u">Разу[/u">[u">Davi[/u">[u">Umbr[/u">[u">Trac[/u">[u">Rela[/u">[u">Хатх[/u">[u">Unre[/u">[u">разн[/u">[u">Псар[/u">[u">реда[/u">[u">Фирс[/u">[u">Чека[/u">[u">Аник[/u">[u">успе[/u">[u">Рома[/u"> [u">Pian[/u">[u">Прос[/u">[u">Тата[/u">[u">Paol[/u">[u">Г-ХА[/u">[u">Гуми[/u">[u">деть[/u">[u">Ершо[/u">[u">Неча[/u">[u">книг[/u">[u">Ярил[/u">[u">Кобз[/u">[u">роди[/u">[u">Indu[/u">[u">Indu[/u">[u">Indu[/u">[u">Know[/u">[u">заме[/u">[u">Моис[/u">[u">Shat[/u">[u">Paul[/u">[u">Алек[/u">[u">Копа[/u">[u">Меща[/u"> [u">репе[/u">[u">Gust[/u">[u">Вагу[/u">[u">Курд[/u">[u">tuchkas[/u">[u">Малю[/u">[u">Wome[/u">