Log in or register to post comments

Push notification for vuforia unity android

January 3, 2013 - 12:39am #1

Hi,

Im trying to add push notification functionality for my Vuforia based unity app.

Could you suggest any simple plugins or best method to acheive the same.

I found pushwoosh plugin which would do the same.

But i found that they too have a MAIN activity intent

           <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

 

But since im using vuforia , im lil confused in how i could update the AndroidManifest.xml.

If there are two main activities , 1 from pushwoosh and one from vuforia(<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"),wont there be any conflicts.

Please help me out in this hurdle too

 

-Elixir.bash

Push notification for vuforia unity android

May 22, 2013 - 12:10am #20

 

Hi,

The last issue, wasn´t pushwoosh related, like I thought. 
There was something messed up with the libs needed for the video-texture. After reimporting everything the app now starts successfully on my device.

Thank you for all the support elixirbash!

I´ll now start testing the app thoroughly, but I hope this topic is solved and closed :)))

Maik

Push notification for vuforia unity android

May 21, 2013 - 8:05am #19

Hmm my idea: 

I wrote in one of my first posts, that I had to use the new QCar 2.0.32, since the changed something for apple (weren´t allowed to read the UDID anymore).
Maybe with that release they needed new permissions, that you have not yet in you manifest?

I´ll try to revert the qcar version to 2.0.31 just for the android release

Maik

Push notification for vuforia unity android

May 21, 2013 - 7:50am #18

Hmm. The App now starts from Unity the same way.
But it breaks off after or during the Splashscreen, which I´m not sure, has to do anything with Pushwoosh anymore...
I get these message in Logcat:

 

05-21 16:43:16.016: E/AR(12491): Error - failed to assert required Android permissions. Failed to initialize QCAR SDK. All required Android permissions must be included for the SDK to work.
...
05-21 16:43:16.032: W/PushEventsTransmitter(12491): No android.permission.BROADCAST_STICKY. Reverting to simple broadcast
05-21 16:43:16.032: W/PushWoosh DeviceFeature2_5(12491): Try To sent AppOpen
...
05-21 16:43:16.219: W/PushWoosh: NetworkUtils(12491): PushWooshResult: {"status_code":200,"status_message":"OK","response":null}
05-21 16:43:16.219: W/PushWoosh DeviceFeature2_5(12491): Send AppOpen success
(I guess, this means Pushwoosh seems ok)
...
05-21 16:43:16.751: E/QCAR(12491): QCAR initialization failed
...
05-21 16:43:17.602: W/libc(12491): WARNING: generic atexit() called from legacy shared library
...
05-21 16:43:18.274: W/libc(12491): pthread_create sched_setscheduler call failed: Operation not permitted
...
05-21 16:43:20.610: E/Unity(12491): Could not initialize the tracker.
05-21 16:43:20.610: E/Unity(12491):  
05-21 16:43:20.610: E/Unity(12491): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 43)
...
05-21 16:43:21.376: E/VuforiaMedia(12491): The library libVuforiaMedia.so could not be loaded
(And this is probably the cause for this:)
...
05-21 16:43:21.540: W/dalvikvm(12491): No implementation found for native Lcom/qualcomm/VuforiaMedia/VideoPlayerHelper;.initMediaTexture:()I
...
05-21 16:43:22.016: W/dalvikvm(12491): threadid=13: thread exiting with uncaught exception (group=0x4129f930)
05-21 16:43:22.024: E/AndroidRuntime(12491): FATAL EXCEPTION: GLThread 4812
05-21 16:43:22.024: E/AndroidRuntime(12491): java.lang.NoClassDefFoundError: com/unity3d/player/UnityPlayer$12
05-21 16:43:22.024: E/AndroidRuntime(12491): at com.unity3d.player.UnityPlayer.setScreenSize(Unknown Source)
05-21 16:43:22.024: E/AndroidRuntime(12491): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
05-21 16:43:22.024: E/AndroidRuntime(12491): at com.unity3d.player.UnityPlayer.onDrawFrame(Unknown Source)
05-21 16:43:22.024: E/AndroidRuntime(12491): at com.qualcomm.QCARUnityPlayer.QCARUnityPlayer.onDrawFrame(QCARUnityPlayer.java:67)
05-21 16:43:22.024: E/AndroidRuntime(12491): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
05-21 16:43:22.024: E/AndroidRuntime(12491): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
05-21 16:43:22.024: E/AndroidRuntime(12491): Caused by: java.lang.UnsatisfiedLinkError: Native method not found: com.qualcomm.VuforiaMedia.VideoPlayerHelper.initMediaTexture:()I
05-21 16:43:22.024: E/AndroidRuntime(12491): at com.qualcomm.VuforiaMedia.VideoPlayerHelper.initMediaTexture(Native Method)
05-21 16:43:22.024: E/AndroidRuntime(12491): at com.qualcomm.VuforiaMedia.VideoPlayerHelper.load(VideoPlayerHelper.java:251)
05-21 16:43:22.024: E/AndroidRuntime(12491): ... 5 more
 

Guess a new topic?!

Any idea?
Maik

Push notification for vuforia unity android

May 21, 2013 - 7:37am #17

there is no need to import the project to eclipse inorder to make pushwoosh work.

the reason i asked for was to check if PACKAGE_NAME has been properly replaced with your apps bundle.

with these changes the app should work seamlessly.

Push notification for vuforia unity android

May 21, 2013 - 7:28am #16

Ok, I now realized, that there were multiple spots in the manifest, where I had to replace "PACKAGE_NAME" with my bundle identifier.

Now the Application compiles and starts, but breaks during or after the Splashscreen. I look into it now and will edit this post later.

 

Maik

Push notification for vuforia unity android

May 21, 2013 - 7:22am #15

 

Hi,

I had much trouble today, because apparently the latest android sdk release (22) is an absolute killer for Unity. Won´t compile at all. Took me quite some time to find the solution to backroll to 21 again.  (No fix from Unity yet)

Actually I´m not exactly at the same point I was before. At the moment eclipse tells me, that my Manifest is malformed.

But to get one thing straight, which I might have missunderstood: Is it for your approach neccessary to export the unityproject as an android-project and open it with eclipse, at all? Or in other words: should your solution work right out of unity without touching the android project itself?

I´ll attach my manifest (without) the IDs here.

Thanks for the effort

Maik

EDIT: I Just found the warning in logcat, that is probably telling me about the problem:

 

05-21 16:19:26.033: W/PackageParser(31801): /data/local/tmp/UnityPushwooshActivity.apk (at Binary XML file line #87): Bad class name PACKAGE_NAME.permission.C2D_MESSAGE in package com.*******.********
 

 

AttachmentSize
Plain text icon manifest.txt5.72 KB

Push notification for vuforia unity android

May 21, 2013 - 4:48am #14

could you share your android manifest

Push notification for vuforia unity android

May 17, 2013 - 5:18am #13

Sorry for the inconvenience and thanks for the attempt to help.
After I was put on another project, I now face this problem after several weeks once more.
I tried for a few hours different things now. 
And had quite some error messages seen in the process.

Could you please give me a more in-detail explanation about the steps?

I´m not sure in which order I am supposed to implement your files.
 

My approach was to :

-Import the Androidfolder you linked into my Unity project
-I replaced the unityPushwoosh.jar with your second file
-I altered the manifest file like descriped in the Pushwoosh manual (filled in the package name and the PushWoosh-App-ID)
-since a build from unity onto my phone didn´t work at this point(it said, that the apk couldn´t be installed), I exported the android-Project from unity and imported it as a new project into my eclipse.
-after I (don´t know why) had to replace my manifest in eclipse once more, which was probably the problem unity had (sorry, did loose overview over all the files) I get the following logcat output:

 

Android Launch!

[2013-05-17 13:58:17 - PWUnityPlayerProxyActivity] adb is running normally.

[2013-05-17 13:58:17 - PWUnityPlayerProxyActivity] Performing com.pushwoosh.unity.PWUnityPlayerProxyActivity activity launch

[2013-05-17 13:58:17 - PWUnityPlayerProxyActivity] Automatic Target Mode: using device '0146B06107011002'

[2013-05-17 13:58:17 - PWUnityPlayerProxyActivity] Uploading PWUnityPlayerProxyActivity.apk onto device '0146B06107011002'

[2013-05-17 13:58:18 - PWUnityPlayerProxyActivity] Installing PWUnityPlayerProxyActivity.apk...

[2013-05-17 13:58:29 - PWUnityPlayerProxyActivity] Success!

[2013-05-17 13:58:30 - PWUnityPlayerProxyActivity] Starting activity com.pushwoosh.unity.PWUnityPlayerProxyActivity on device 0146B06107011002

[2013-05-17 13:58:31 - PWUnityPlayerProxyActivity] New package not yet registered with the system. Waiting 3 seconds before next attempt.

[2013-05-17 13:58:34 - PWUnityPlayerProxyActivity] Starting activity com.pushwoosh.unity.PWUnityPlayerProxyActivity on device 0146B06107011002

[2013-05-17 13:58:34 - PWUnityPlayerProxyActivity] New package not yet registered with the system. Waiting 3 seconds before next attempt.

[2013-05-17 13:58:37 - PWUnityPlayerProxyActivity] Starting activity com.pushwoosh.unity.PWUnityPlayerProxyActivity on device 0146B06107011002

[2013-05-17 13:58:38 - PWUnityPlayerProxyActivity] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.beColumbus.Milchland/com.pushwoosh.unity.PWUnityPlayerProxyActivity }

[2013-05-17 13:58:38 - PWUnityPlayerProxyActivity] New package not yet registered with the system. Waiting 3 seconds before next attempt.

[2013-05-17 13:58:41 - PWUnityPlayerProxyActivity] Starting activity com.pushwoosh.unity.PWUnityPlayerProxyActivity on device 0146B06107011002

[2013-05-17 13:58:41 - PWUnityPlayerProxyActivity] New package not yet registered with the system. Waiting 3 seconds before next attempt.

[2013-05-17 13:58:44 - PWUnityPlayerProxyActivity] Starting activity com.pushwoosh.unity.PWUnityPlayerProxyActivity on device 0146B06107011002

[2013-05-17 13:58:45 - PWUnityPlayerProxyActivity] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.beColumbus.Milchland/com.pushwoosh.unity.PWUnityPlayerProxyActivity }

[2013-05-17 13:58:45 - PWUnityPlayerProxyActivity] ActivityManager: Error type 3

[2013-05-17 13:58:45 - PWUnityPlayerProxyActivity] ActivityManager: Error: Activity class {com.beColumbus.Milchland/com.pushwoosh.unity.PWUnityPlayerProxyActivity} does not exist.

To add to the confusion: Since I use Video-Textures in my project I´ve set Ice Cream Sandwich(4.0) as my min.SDKVersion.

After the export for eclipse I altered the MinSDKVersion infos in the files accordingly.

Since I´m quite sure, that I get the order of the steps wrong: Could you please give me a more detailed explanation?
Sorry :(

Thanks
Maik

PS: Since I had to upload the App to the iOS Appstore in the meantime I had to update to QCar 2.0.32 (in order to meet a new apple regulation)
Could it have anything to do with this?

 

 

Push notification for vuforia unity android

April 18, 2013 - 9:08pm #12

Hey guys,

I got Pushwoosh plugin to work with Vuforia in uinity , few weeeks back. Sorry for the delay in replying.

Il give a step by step process :

1)Download https://github.com/shaders/unity-pushwoosh-jar/tree/Vuforia-Unity/UnityPushwoosh

2) Replace the UnityPushwoosh.jar with https://github.com/shaders/unity-pushwoosh-jar/blob/Vuforia-Unity/UnityPushwoosh/UnityPushwoosh.jar

3)Important!! USE ONLY THE ANDROID MANIFEST THAT COMES WITH PUSHWOOSH AND DO NECESSARY CHANGES.THE NEW JAR WILL TAKE CARE OF EXTENDING THE MAIN ACTIVITY FOR VUFORIA.

 

Try this out!!

regards,

Elixir.bash

Push notification for vuforia unity android

April 18, 2013 - 5:19am #11

Here is a Vuforia-Unity branch with a sample project of Pushwoosh integration with Unity and Vuforia:https://github.com/shaders/unity-pushwoosh-jar/tree/Vuforia-Unity

Push notification for vuforia unity android

April 18, 2013 - 2:35am #10

Hi,

has there been any progress on this issue. I currently have to integrate Push into my next App. While it was quite easy for iOS. (I used Pushwoosh)
I don´t see a clear way for Android yet, since it has been made clear in this post, that Pushwoosh can´t be used together with Vuforia, since both need to be the MainActivity in the Manifest.

The only possibility I see as of now (but would probably take me quite some time, since I´m not a routine android developer) would be to export a real android project out of unity and integrate the push the "manuel way". 

Prime31 Etcetera seems to not be an option either, because apparently is has stopped the suppport for Android Push.

I´d be really thankful if somebody had an idea about how to tackle this some other way.

Maik

Push notification for vuforia unity android

March 20, 2013 - 9:41am #9

I know AllJoyn and have used in my app ;). But this is not a Push Notification Solution, this is a Multiplayer Solution. You got something mistaken ;)

Push notification for vuforia unity android

March 20, 2013 - 8:50am #8

Have you checked out AllJoyn? - they provide a Unity plugin

https://www.alljoyn.org/

Zombie Toy is a Vuforia based game..

https://www.alljoyn.org/app-developers/featured-apps

Push notification for vuforia unity android

March 20, 2013 - 8:03am #7

 

Hello elixirbash,

Have you ever found a solution for Push Notifications for Unity Android with Vuforia?

Thank you!

 

Regards,

Russel

Push notification in android

January 3, 2013 - 6:06am #6

Thats a bunch of info i could feed on for solution AlessandroB!!

Thanks a ton.. will keep posted ..

-Elixir.bash

Hi elixirbash, thanks for

January 3, 2013 - 5:42am #5

Hi elixirbash, thanks for sharing the AndroidManifest. Actually by looking at it, I can now see that the pushwoosh activity is also a sort of Unity proxy activity, and not a simple generic android activity; this makes things more complicated because both QCARPlayerActivity and the Pushwoosh activity need to be main activities and both extend the Unity player activity;

in this case it will be really hard to make them coexist, unless you have access to the source code of the Pushwoosh and can "refactor" that activity into the QCAR one (but that would be very complex).

What I would suggest is to try to see if you can find some push notification API for Android that do not rely on Unity activities, i.e. something that provides just the basic Android features, which you could then more easily integrate.

Push notifications for Android are also discussed in this forum thread (maybe you can find some useful info there):

http://stackoverflow.com/questions/1378671/push-notifications-in-android-platform

 

Also, if you are familiar with Android development with Eclipse, you may want to also have a look at this Post, which shows an approach to export a Unity project to an Eclipse project and then being able to directly work in Java from Eclipse (thus allowing you to integrate any Android-related stuff in your Unity-based App):

https://developer.vuforia.com/forum/faq/unity-how-can-i-extend-unitys-android-activity

 

IHTH.

Push notification in android

January 3, 2013 - 4:42am #4

Apart from this plugin , please do let me know other means of acheiving server based push notification for vuforia unity android..

 

Push notification in android

January 3, 2013 - 4:41am #3

AlessandroB wrote:

Hi elixirbash,

in Android you cannot have 2 main activities, so you will have to keep just one activity as MAIN;

so, you should only use the intent-filter with the MAIN and LAUNCHER attributes for the QCARPlayerProxyActivity (not for the pushwoosh one).

I haven't directly tried integrating pushwoosh as a plugin, but technically you should be able to merge the two android manifests into one single manifest; I would recommend that you keep your current QCAR Unity project manifest (which should be located under Assets/Plugins/Android) and you just add the extra elements to it by copy-pasting them from the pushwoosh manifest. 

I hope this helps.

 

 

 

 

Thank you for replying Asessandro.

I did copy them and integrate.The app crashes when a call is made to pushwoosh JNI as i could see.

I edited my manifest in the following way.

 

        <activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"
                  android:label="@string/app_name"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
              <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

         <activity android:label="@string/app_name" android:name="com.pushwoosh.unity.PWUnityPlayerProxyActivity" android:screenOrientation="portrait" android:launchMode="singleTop" android:configChanges="locale|mcc|mnc|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

 

I made the qcar activity as the default launcher..

I made this change WRT www.daily3gp.com/vids/747.3gp

Im now trying to figure out the right reason for the app crash..

Please share your thought on this..

will keep you updated if i make progress

Hi elixirbash, in Android you

January 3, 2013 - 3:26am #2

Hi elixirbash,

in Android you cannot have 2 main activities, so you will have to keep just one activity as MAIN;

so, you should only use the intent-filter with the MAIN and LAUNCHER attributes for the QCARPlayerProxyActivity (not for the pushwoosh one).

I haven't directly tried integrating pushwoosh as a plugin, but technically you should be able to merge the two android manifests into one single manifest; I would recommend that you keep your current QCAR Unity project manifest (which should be located under Assets/Plugins/Android) and you just add the extra elements to it by copy-pasting them from the pushwoosh manifest. 

I hope this helps.

 

 

 

Log in or register to post comments