.
101 How To Register For PushBots Services
Application ID: 56e74ca237d9b074628b4567
Application Secret: 7e8daed7aac0fcaab8d219a363f73b3c
Project ID: moja107-1251
Project number: 926083370846 → Sender Id
Sender Id: 926083370846
|
API Key: AIzaSyDV8vlwzN2y8phIuTGRYBf9kYQNWRpzKew → Server Key
Server Key: AIzaSyDV8vlwzN2y8phIuTGRYBf9kYQNWRpzKew
|
Get back to Pushbot Project Dashboard and paste the API Key.
Select API Level (e.g 15)
Select Blank Activity.
Add dependencies statement in build.gradle (module:app)
compile 'com.pushbots:pushbots-lib:2.0.13@aar'
compile 'com.android.support:support-v4:23.1.1'
|
Update Android Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.notarazi.moja107pushbottest">
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="com.notarazi.moja107pushbottest.permission.C2D_MESSAGE"android:protectionLevel="signature" />
<uses-permissionandroid:name="com.notarazi.moja107pushbottest.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive dataf message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="com.notarazi.moja107pushbottest.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.pushbots.google.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.notarazi.moja107pushbottest" />
</intent-filter>
</receiver>
<receiver android:name="com.pushbots.push.DefaultPushHandler" />
<service android:name="com.pushbots.push.GCMIntentService" />
</application>
</manifest>
|
res/values/pushbots.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Pushbots Application ID -->
<string name="pb_appid">56e74ca237d9b074628b4567</string>
<!-- GCM Sender ID -->
<string name="pb_senderid">926083370846</string>
<!-- Pushbots Log Level log Tag "PB2" -->
<string name="pb_logLevel">DEBUG</string>
</resources>
|
MainActivity.java
package com.notarazi.moja107pushbottest;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import com.pushbots.push.Pushbots;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Pushbots.sharedInstance().init(this);
//Pushbots.sharedInstance().setNotificationEnabled(true);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
|
...
|
DOWNLOAD
101PushbotTest.zip
.
how enable push bots, in signed apk?
ReplyDeleteI really like your blog. You make it interesting to read and entertaining at the same time. I cant wait to read more from you.
ReplyDeleteData science training in Bangalore
Data Science training in marathahalli
Data Science training in btm
Data Science training in rajaji nagar
Data Science training in chennai
Data Science training in kalyan nagar
Data Science training in electronic city
Data Science training in USA
You’ve written a really great article here. Your writing style makes this material easy to understand.. I agree with some of the many points you have made. Thank you for this is real thought-provoking content
ReplyDeletePython training in marathahalli
Python training institute in pune
You’ve written a really great article here. Your writing style makes this material easy to understand.. I agree with some of the many points you have made. Thank you for this is real thought-provoking content
ReplyDeletePython training in marathahalli
Python training institute in pune
Very Helpful Post And Explained Very Clearly About All the things.Very Helpful to me.Thank you.
ReplyDeleteaws online training | aws training in hyderabad | aws online training in hyderabad
Great content thanks for sharing this informative blog which provided me technical information keep posting.
ReplyDeleteangularjs Training in marathahalli
angularjs interview questions and answers
angularjs Training in bangalore
angularjs Training in bangalore
angularjs online Training
angularjs Training in marathahalli
Mind blowing content!! Thanks for uploading
ReplyDeleteSelenium Training in Chennai
software testing selenium training
ios developer course in chennai
Digital Marketing Course in Chennai
android training center in chennai
best android training center in chennai
Big Data Training in Chennai
Read all the information that i've given in above article. It'll give u the whole idea about it.
ReplyDeleteAuthorized iphone service center in Chennai | iphone service center in chennai | Mobile service center in chennai | Authorized iphone service center in Chennai | iphone service center in chennai
"Your blog is absolutely fantastic and great
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"