- Install dependencies:
npm install - Edit
index.jsand provide your instance id and secret key. You can find them by clicking on theCredentialstab on the Beams the dashboard: https://dash.pusher.com/beams - Run the server:
npm start - Server should be running on:
http://localhost:3000/. If everything works, you should see: Hello World! - Visit:
http://localhost:3000/auth?user_id=XYZ, whereXYZis your user id. - You should receive a token back:
{
"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NjA3NzczOTMsImV4cCI6MTU2MDg2Mzc5MywiaXNzIjoiaHR0cHM6Ly9ZWVkucHVzaG5vdGlmaWNhdGlvbnMucHVzaGVyLmNvbSIsInN1YiI6IlhZWiJ9.90f4EZTAEsd6t6wQJTxTEN7E2x9rsX2W1Emoae394W4"
}
- Ensure you add your google-services.json from firebase with the package
com.pusher.demo.myapplication - Open the project in Android Studio
- Open MainActivity.kt
- Write your beams instance id into the placeholder variable
- Write out your auth url by pointing to your laptop ip address that's running the backend server e.g.
http://192.168.6.27:3000/auth - Press play, and ensure the emulator or device is on the same wifi network as the lapotp running the backend server.
- You should get a logcat message to say
Beams login success!
- Ensure that iOS SDK is successfully configured by following our docs.
- Open the
PushNotifications.xcworkspaceinios/push-notifications-swift. - Select
push-notifications-iosproject and open theAppDelegate.swiftfile. - Add correct values for
instanceId,authURL, anduserId. - Run the project on your device. If successfull, you should see the
All good!message in your console.
- Navigate to the
http://localhost:3000/ - Populate the empty text fields:
User idandNotification message, and pressSubmitbutton.