Parse Unity SDK does not work in an Android build - android

I use Parse Unity SDK as a solution for cloud storing of all the relevant gameplay statistics. The SDK works perfectly well in the Unity editor. However, when the project is built for Android and deployed on a device, not a single piece of functionality seems to be working - a user can't sign up, log in or place any kind of data into the Parse cloud.
I have tested this from within a simple project, to avoid possible 3rd party plugin conflicts, but the result was the same.
The AndroidManifest.xml file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.toybox.parsetest"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature" android:name="com.toybox.parsetest.permission.C2D_MESSAGE" />
<uses-permission android:name="com.toybox.parsetest.permission.C2D_MESSAGE" />
<application android:label="ParseTest" android:icon="#drawable/app_icon">
<activity android:name=".UnityPlayerActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" 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.toybox.parsetest" />
</intent-filter>
</receiver>
<service android:name="com.parse.ParsePushService" />
</application>
</manifest>

You might want to follow this official bug thread for the issue...
https://developers.facebook.com/bugs/1623483557935932/
EDIT : At the bottom of the thread the developer has posted a package, which seems to have some other files and a manifest in the Plugins/Android folder. It seems you need to make sure you keep these files, and it will work.
You can download the package from
https://www.dropbox.com/s/oc0orevllrf1ylm/Fixed-Parse-Unity-Android-Bug-1.5.2.zip?dl=0

Related

Distriqt ANE key cannot be verified in Android

I am developing an App for iOS and Android, for this app I am using ANEs from distriqt, and they say they work for both platforms. In iOS these ANEs work but when I develop in Android I get the error: Your key was not able to be verified for the com.distriqt.Notifications native extension, but the key works for NetworkInfo ANE.
If you have had a similar situation with these ANEs, could you please help me to attack this problem?
Thank you very much.
PD: My descriptor for android where i declare the extensions is below.
<extensions>
<extensionID>com.milkmangames.extensions.GoViral</extensionID>
<extensionID>com.distriqt.NetworkInfo</extensionID>
<extensionID>com.distriqt.InAppBilling</extensionID>
<extensionID>com.distriqt.Application</extensionID>
<extensionID>com.distriqt.Notifications</extensionID>
<extensionID>com.distriqt.PushNotifications</extensionID>
<extensionID>com.distriqt.Core</extensionID>
</extensions>
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto" >
<!--<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>-->
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Only this application can receive the messages and registration result -->
<permission android:name="com.4starscasino.4StarsCasino.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.4starscasino.4StarsCasino.permission.C2D_MESSAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<application>
<receiver android:name="com.distriqt.extension.notifications.NotificationsReceiver">
<intent-filter>
<action android:name="com.4starscasino.4StarsCasino.NOTIFICATION" />
<action android:name="com.4starscasino.4StarsCasino.DELAYED_NOTIFICATION" />
</intent-filter>
</receiver>
<receiver android:enabled="true" android:exported="true" android:name="com.distriqt.extension.pushnotifications.PushNotificationsBroadcastReceiver" 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.4starscasino.4StarsCasino" />
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="true" android:name="com.distriqt.extension.pushnotifications.gcm.GCMIntentService" />
<receiver android:name="com.distriqt.extension.pushnotifications.PushNotificationsReceiver">
<intent-filter>
<action android:name="com.4starscasino.4StarsCasino.PUSHNOTIFICATION_SELECTED" />
<data android:scheme="dtpn" />
</intent-filter>
</receiver>
<receiver android:enabled="true" android:name="com.distriqt.extension.application.receivers.ApplicationStartupReceiver" android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.LoginActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="Login" />
<!-- replace 000000000000000 with your numeric Facebook Application ID -->
<provider android:authorities="com.facebook.app.NativeAppCallContentProvider634656129942853" android:name="com.facebook.NativeAppCallContentProvider" />
<!-- replace 000000000000000 with your numeric Facebook Application ID, and com.yourcompany.example with your apks application ID -->
<meta-data android:name="com.4starscasino.4StarsCasino" android:value="634656129942853"/>
<activity android:name="com.distriqt.extension.inappbilling.activities.PurchaseActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar"></activity>
</application>
</manifest>
]]></manifestAdditions>
<!-- Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after -->
<!--<colorDepth></colorDepth>-->
<!-- Indicates if the app contains video or not. Necessary for ordering of video planes with graphics plane, especially in Jellybean - if you app does video this must be set to true - valid values are true or false -->
<!-- <containsVideo></containsVideo> -->
</android>
The issue will be with your application id, as it's not a valid Java package name, AIR will convert it to a valid one when creating the application apk. However this will cause issues with your manifest additions and key validation.
Basically starting a package name with a number or using hyphens are not valid in Java. You should either change your application id to something like:
com.fourstarscasino.fourStarsCasino
Or else you'll have to determine the actual Android package name and use that instead. It probably is something like:
com.A4starscasino.A4StarsCasino
You should unzip the apk and check the AndroidManifest.xml for the actual Android package name.

Android device not showing alert in response to remote push notification when the app is not running

I saw many other questions on here saying if an app is force stopped it won't receive notifications.
However, I AM NOT force stopping this app. I am just hitting the back button. I have also tried just hitting the home button. In both cases no alerts.
However, if the app is running in the foreground the PushReceived event fires and the AData.Message shows the correct text. So, it would appear that remote notifications are being sent to the device, it's just that the app is never woken up to process them.
The app is written in Delphi XE8 and I have tested this on KitKat and JellyBean, both with the same results.
I suspect the problem is in the Android Manifest file. A copy of which is below. Beyond this I am not sure where to go. As I understand it when a push is received it is supposed to run a small bit of code in the Firemonkey framework that displays the push message without starting the full app.
I am using the app described in this tutorial to try to figure out why it is not working in my live app. This used to work as I expected it to in XE7.
http://docwiki.embarcadero.com/RADStudio/XE8/en/Mobile_Tutorial:_Using_Remote_Notifications_%28iOS_and_Android%29
I am using the Engagement Tab on the Kinvey dashboard to send the test pushes, so I assume the server side is correct. And as I said they are working with the app in the foreground.
Gary
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.gwsystemsdns.net.pushtest"
android:versionCode="1"
android:versionName="1.0.0"
android:installLocation="preferExternal">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="net.gwsystemsdns.net.pushtest.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="net.gwsystemsdns.net.pushtest.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="False"
android:restoreAnyVersion="False"
android:label="PushTest"
android:debuggable="True"
android:largeHeap="False"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true">
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="PushTest"
android:configChanges="orientation|keyboard|keyboardHidden"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="PushTest" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm" />
<receiver android:exported="true" android:name="com.embarcadero.gcm.notifications.GCMNotification" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="net.gwsystemsdns.net.pushtest" />
</intent-filter>
</receiver>
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
My Push Received event demonstrating the reception of foreground pushes.
procedure TfrmMain.PushEvents1PushReceived(Sender: TObject; const AData: TPushData);
begin
Memo1.Lines.Add('Push Received');
Memo1.Lines.Add('Push = ' + AData.Message);
end;
I found the problem. This line was missing from the XE8 manifest template file:
<%activity%>
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
<%receivers%>
</application>
It goes into the AndroidManifest.template.xml file like this (immediately following the <%receivers%> tag:
<%activity%>
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
<%receivers%>
<receiver android:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm" />
</application>
As per Embarcadero's docwiki.

Android Manifest: no default activity?

From an open source project I got this manifest file
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="20" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<service
android:name="org.gege.caldavsyncadapter.syncadapter.SyncService"
android:exported="true">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="#xml/syncadapter" />
</service>
<service
android:name="org.gege.caldavsyncadapter.authenticator.AuthenticationService"
android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
</service>
<activity
android:name="org.gege.caldavsyncadapter.authenticator.AuthenticatorActivity"
android:label="#string/title_activity_authenticator"
android:windowSoftInputMode="adjustResize|stateVisible"/>
</application>
I am a bit puzzled about that manifest. It has two services and one activity. The activity is not marked as default activity. When I run the project on my phone it doesn't show any icon to start the app neither does the app start automatically.
Does a manifest like this make sense? What does the Android OS based on such a manifest?
Does a manifest like this make sense?
Yes, since it declares a sync adapter an an authenticator.
Generally, such manifests would also make sense in a library project. The app project that uses the library then provides the main launcher activity. The build process merges manifest files together so you get one manifest per APK.
What does the Android OS based on such a manifest?
As such, it has the entry points such as an activity and two services declared. Generally you invoke these entry points via an Intent. The services are declared as a sync adapter and an authenticator, so they can be invoked by the framework. The activity is probably invoked by the authenticator service for UI purposes.
Because there's no main launcher activity, no menu icon is visible.

PushBot Android client not working

I followed the instruction but when I test sending the message I do not receive anything.
There are no errors in the application and the pushbot console sees that that there is a registered device.
How can I find out what is going on ?
The Code is very template like and follows all instructions that they have provided.
The application
import com.pushbots.push.Pushbots;
import android.app.Application;
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
String SENDER_ID = "ID here";
String PUSHBOTS_APPLICATION_ID = "Pushbot App Id";
Pushbots.init(this, SENDER_ID,PUSHBOTS_APPLICATION_ID);
}
}
The manifest looks like the following
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.zuppush"
android:versionCode="1"
android:versionName="1.0" >
<!-- 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" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<permission android:name="com.example.zuppush.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.zuppush.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:name="com.example.zuppush.MyApplication"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.zuppush.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.example.zuppush.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.pushbots.push.PBMsg"/>
<activity android:name="com.pushbots.push.PBListener"/>
<receiver
android:name="com.google.android.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.example.zuppush" />
</intent-filter>
</receiver>
<receiver android:name="com.pushbots.push.MsgReceiver" />
<service android:name="com.pushbots.push.GCMIntentService" />
<service android:name="org.openudid.OpenUDID_service" >
<intent-filter>
<action android:name="org.openudid.GETUDID" />
</intent-filter>
</service>
</application>
</manifest>
I'm not sure which version of com.google.android.gcm.GCMBroadcastReceiver you are using, but if it's the default implementation taken from the old client GCM library, this implementation expects the GCMIntentService to be in the main package of your app (com.example.zuppush), which is not the case.
I just signed up for pushbots recently. No technical support. No one is answering the phone. Their phone number forwards to a business that has nothing to do with pushbots. Please be aware, I don't think this company exists anymore. I lost my 1st month subscription to the service, without any service actually being delivered. I assume that pushbots service is no longer available, and that no one is still using the service, despite the fact that they are still accepting credit cards on their web site. Sketchy.

android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE what's the use?

I am trying to execute the OnReceive method when Android starts so that I can schedule
a task.
Unfortunately onReceive of my BradcastReciever is called at boot only if I install the app on the
root system. I thought that android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE
should fix the problem.
But from this post it seems that it is not possible, though in certain tutorials
they say it is feasible.
Android installLocation and BOOT_COMPLETED
I should infer that I cannot do such a thing.
Is that really so or there is a way to get the broadcast at startup with my app on the sd.
If it is not possible I wonder what's the use
of android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE
This is my Manifest in case someone wnat to take a look.
I am testing on Android 2.3.7
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackage"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
.............................
<receiver
android:name="mypackage.MyNotificationReceiver"
android:enabled="true"
>
<intent-filter android:priority="1" >
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" />
</intent-filter>
</receiver>
</application>
</manifest>
Thanks
First you have to split intent filter
Something like this:
<receiver
android:name="mypackage.MyNotificationReceiver"
android:enabled="true"
>
<intent-filter android:priority="1" >
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" />
</intent-filter>
</receiver>
Every filter should have only one action.
Second, a question: ACTION_EXTERNAL_APPLICATIONS_AVAILABLE occurs always some time after BOOT_COMPLETED (the device first completes boot, then reads card). So why both actions?

Categories

Resources