Unable to create an audience on Parse - parse-platform

I am trying to get my android app setup to send push notifications via Parse.
build.gradle
compile 'com.parse:parse-android:1.13.0'
Application.java
//in onCreate
Parse.initialize(this, "appId", "clientKey");
ParseInstallation.getCurrentInstallation().saveInBackground();
AndroidManifest.xml
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="MY_APP_ID" />
</intent-filter>
</receiver>
After booting up my app with these changes, I can see an installation object being created on the Parse dashboard.
Now when I try to send a push via the dashboard and create an audience with platform Android, it says 'Your recipient count for this campaign can’t be empty.'
What am I missing?
EDIT 1: I am able to send a push via the REST api. Still not able to send push via the web console.

I had submitted this issue to the Facebook Developers page. This is the response that I received from the Facebook Engineering Team:
This is a known issue with small recipient counts in the new dashboard. Unfortunately the engineering team doesn't plan to solve this bug in the new dashboard. Please use the old dashboard to send these push notifications.

Related

Intercom not working on android 12 Xamarin forms

io.intercom.android.sdk.fcm.IntercomFcmMessengerService: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
I know I have to add something in the manifest similar to this but still not finding it
<receiver android:name="" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</receiver>
In Android 11 and lower, when declaring an Activity, Service, or Broadcast receiver in AndroidManifest, you did not explicitly declare android:exported. Since the default value is exported=true, you only need to declare exported=false when you do not want to disclose to the outside.
For example:
<activity android:name="com.example.app.backgroundService">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</activity>
Android 12 Changes: Explicit declaration of exported Apps that set SDK API 31 (android 12) as Target sdk on Android 12 devices must explicitly declare exported in components such as Activity that declared intent-filter.
For example,you must explicitly declare exported as follows:
<service android:name="com.example.app.backgroundService"
android:exported="false">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</service>
In a word, android:exported="true" or "android:exported="false" must be added to all receivers, services, and activity tags with intent-filters inside them.
Note:
You can find the AndroidManifest.xml in folder obj of your app. My Folder is MyAndroidProject\obj\Debug\120\.
After finding file AndroidManifest.xml, you can recheck if you have added tag android:exported to all of your receivers, services, and activity.

Sending pushes to devices without google play account

We're developping an Android app which uses Parse. All devices that install the app have their deviceToken and pushType registered in _Installation Parse Table upon registration, since they have google play accounts. They all receive push notifications from Parse without any problems.
I have a fairphone device which has been used for testing purposes since the beginning. It has never had google play account, but Parse push notifications were succesfully received without problems. But some three months ago, this device doesn't get push notifications anymore. I have uninstalled the app completely, erased all data, given again permission to receive notifications, but nothing works.
I can't understand why this device doesn't get push notifications from Parse.
My question is: is there a way to debug my app and discover why a certain device doesn't get parse push notifications?
This is my manifest part related to parse push notifications:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="br.org.eita.responsa.push.ResponsaPushReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="br.org.eita.responsa" />
</intent-filter>
</receiver>

Parse - Installation table not setting deviceToken nor pushType

I had an app working on Parse, with the notifications working fine. I changed app packaging and I create a new app on Parse.
With the new app, deviceToken and pushType columns remain always empty on table _Installation, so pushes doesn't work even if sent from Parse web page, and a new entry is generated as application is launched.
I've updated parse keys on my java code and on my cloud code.
Someone has some idea what I may have missed or what may happen so the same code has different behaviour in different apps with equivalent configurations?
If I update one of the installation with pushType="gcm" and "deviceToken" the one I had in the other app, this device receives notifications.
Thank you
okay, I had a similar issue. both those columns were empty.
this is mainly due to the manifest issue.
your permissions seem okay because you are getting the notification and also able to reg in the parse data base.
so the problem should be in the <receiver> tags there should only be 2 of them like mine.
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!--
IMPORTANT: If you change the package name of this sample app,
change "com.parse.tutorials.pushnotifications" in the lines
below to match the new package name.
-->
<category android:name="com.example.ifis" />
</intent-filter>
</receiver>
if you have any receiver like "com.google.android.gcm.GCMBroadcastReceiver" pls remove and also one <service android:name="com.parse.PushService" />
Enable parse logging:
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
In my case I was missing GCM permissions
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="my.package.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="my.package.permission.C2D_MESSAGE" />

Parse.com how to enable client pushes

I'm targeting specific users when sending Parse notifications, using their email address. The send seems to work okay, but no message is received. What do I need to change to receive the message?
In my Parse control panel it shows the attempted pushes but with the error message that "client-initiated pushes are not enabled". I really prefer initiating the pushes from the client. How do I enable that? I keep finding documentation that says to enable client pushes but I can't find how to do it.
Here is my setup:
Parse.initialize(this, "...xxxAPP_ID", "...xxxCLIENT_KEY");
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseObject parseObject = new ParseObject("defaultObject");
parseObject.put("email", sEmail)
parseObject.saveInBackground();
The actually sending is done here:
ParseQuery pQuery = ParseInstallation.getQuery();
pQuery.whereEqualTo("email", ToUser);
ParsePush parsePush = new ParsePush();
parsePush.setQuery(pQuery);
parsePush.sendMessageInBackground("You have pictures waiting from " + sEmail, pQuery);
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature"
android:name="com.pictureplay.permission.C2D_MESSAGE" />
<uses-permission android:name="com.pictureplay.permission.C2D_MESSAGE" />
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.pictureplay" />
</intent-filter>
</receiver>
Update: I have narrowed the problem down to push notifications being received unless the service is not running. I thought the Parse service was supposed to load when the phone restarts, but this is not the case here. Is there a way to get the Parse service for my app to load when the phone reboots?
Update2:
The solution was to create a separate class (called "App" in my case) which initializes Parse. If the Parse service gets shut down when the app closes, the service restarts itself within minutes (automatically, I did no special setup for this) to be able to receive incoming push messages. These are the lines of code used in "App" onCreate:
Parse.enableLocalDatastore(this);
Parse.initialize(this, "data1", "data2"); //supply your own
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
Have you enable Sending notifications from Client. Its a setting in Parse.com.
Go to settings ->App Permissions ->Allow client class creation. Set it to ON>
In your parse application Go to settings > Push > Client Push Enabled > set to Yes
The question Is there a way to get the Parse service for my app to load when the phone reboots? : Yes you can receive the BOOT_COMPLETE event if you have added the following permission on your manifest.
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>
In the new Parse DashBoard: go to settings---> push ---> push notification settings---> client enabled push --- >set to "yes"

Rhomobile: Custom URL Schemes

I'm writing a Rhomobile application targeted at iPhone and Android.
I need to create a custom url scheme, so that i can create urls that look like test://some-params that will launch my program and will pass it the params.
As far as I understand this is done in build.yml through the BundleURLScheme parameter, and then System.get_start_params() to get those parameters.
However, this works on the iPhone only as far as I understand.
Is there any way to make this work on Android too?
Thanks alot!
OKay, I've found the answer myself, in case anybody needs this too:
Create an extension to the application as explained here:
http://docs.rhomobile.com/rhodes/extensions#generating-a-native-extension-template
Add an android_manifest_changes file, as decribed in the above link.
In that file add the following lines:
<manifest xmlns:android='http://schemas.android.com/apk/res/android'
android:versionName='1.0' package='com.rhomobile.webbrowserpoc'
android:versionCode='10000' android:installLocation='auto'>
<application android:name='com.rhomobile.rhodes.RhodesApplication'
android:label='#string/app_name' android:icon='#drawable/icon'
android:debuggable='true'>
<activity android:name='com.rhomobile.rhodes.RhodesActivity'
android:label='#string/app_name' android:launchMode='singleTask'
android:configChanges='orientation|keyboardHidden'
android:screenOrientation='unspecified'>
<intent-filter>
<action android:name='android.intent.action.VIEW' />
<category android:name='android.intent.category.BROWSABLE' />
<category android:name='android.intent.category.DEFAULT' />
<data android:pathPrefix='' android:scheme=''
android:host='' />
</intent-filter>
</activity>
</application>
Only the <data android:pathPrefix='' android:scheme='' android:host='' /> line should be filled in with correct properties.

Resources