push notification

I have this example code below that sends notification to smartphone using blynk. What code does it sends only with virtual app button i want to add extra lines so it will send code then i press physical button on my breadboard. Any one can help with it?

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth = “YourAuthToken”;

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid = “YourNetworkName”;
char pass = “YourPassword”;

void notifyOnButtonPress()
// Invert state, since button is “Active LOW”
int isButtonPressed = !digitalRead(2);
if (isButtonPressed) {
Serial.println(“Button is pressed.”);

// Note:
// We allow 1 notification per 15 seconds for now.
Blynk.notify(“Yaaay… button is pressed!”);

void setup()
// Debug console

Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, “blynk-cloud.com”, 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

// Setup notification button on pin 2
pinMode(2, INPUT_PULLUP);
// Attach pin 2 interrupt to our handler
attachInterrupt(digitalPinToInterrupt(2), notifyOnButtonPress, CHANGE);

void loop()

My guess is that the Blynk.notify("Yaaay... button is pressed!") does not work when interrupts are disabled, like in an ISR. Can't you just check your button in loop()?

void loop()
  static boolean previousButtonState = false;
  if (!digitalRead(2)) // pressed now
    if (!previousButtonState )) {  // not pressed before
      Serial.println("Button is pressed.");
      Blynk.notify("Yaaay... button is pressed!");
    previousButtonState = true; // pressed
  } else { // not pressed now
    previousButtonState = false; // not pressed

I dont really get it. Can you show me how its done. Thanks

Are you for real? He literally posted the code you need in the post. What more do you want? It's already been spoon fed to you. What more do you need?

If you want someone to "just make it work for me" then head over to the Gigs and Collaborations section and hire someone to write it for you. Otherwise you gotta put in at least some effort.