Edit: Now working! Silly me forgot to add some jni files Edit 2: App only works if it is run on phone through Eclispe(run -> choose devices connected by adb). The app still "crashes" if I do a regular packaging of the app. Do I have to use a key other than the default debug key?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
When you compile eclipse by default uses the debug android key to sign the app. Il keep working on it later today. Is this plugin going to be packaged with the next release of Gideros?
Hey @ar2rsawseen now the app crashes no matter how I install it. It looks like the NotificationManager class is not available even though I do system.loadLibrary("notification"); and add it to external classes like :"com.giderosmobile.android.plugins.notification.NotificationClass" I have attached a log filtered to read only my app package debug info.
For the debug file, the "PushNotificationController" is just a lua file I have that controls all notifications. I have attached is as PushNotificationController.txt. Feel free to just make it a .lua to examine where the error occurs.
Oh goodness, I thought Notification would be globally as soon as the app launched and guess what, I forgot to call a simple "require("notification")"! Great lib @ar2rsawseen look forward to using it!
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Hello, I've updated the repo, renamed events correctly for consistency (removed ON_) for both IOS and Android, and also changed example Gideros project.
About the crash you were, having, well I haven't experienced anything like that, but that specific call, actually was not required, all the contents being released in previous loop and object being auto released, thus I just removed it.
07-1413:23:02.248: D/Gideros(13811): *CppLuaBridge::luaEvent* stack NOT ok begin:3end:6 delta:0
07-1413:23:02.248: D/Gideros(13811): *EventDispatcherBinder::dispatchEvent* stack NOT ok begin:2end:6 delta:0
07-1413:23:02.248: D/Gideros(13811): *visit(MouseEvent* v)* stack NOT ok begin:0end:6 delta:0
07-1413:23:02.248: D/Gideros(13811): *CppLuaBridge::luaEvent* stack NOT ok begin:0end:6 delta:0
07-1413:23:02.248: D/Gideros(13811): *enterFrame* stack NOT ok begin:0end:6 delta:0
07-1413:23:02.248: D/Gideros(13811): C:/Gideros_Development/Deployments/Bubble-Adventure-Colors/assets/assets/level_select.lua.jet:186: attempt to index global 'Notification'(a nil value)
07-1413:23:02.248: D/Gideros(13811): stack traceback:
07-1413:23:02.248: D/Gideros(13811): C:/Gideros_Development/Deployments/Bubble-Adventure-Colors/assets/assets/level_select.lua.jet:186: infunction<C:/Gideros_Development/Deployments/Bubble-Adventure-Colors/assets/assets/level_select.lua.jet:182>
07-1413:23:02.248: D/Gideros(13811): C:/Gideros_Development/Deployments/Bubble-Adventure-Colors/assets/assets/classes/button.lua.jet:50: infunction<C:/Gideros_Development/Deployments/Bubble-Adventure-Colors/assets/assets/classes/button.lua.jet:46>
07-1413:23:02.278: D/MediaPlayer(13811): pause()in
07-1413:23:02.278: D/MediaPlayer(13811): pause() out
07-1413:23:02.769: D/MediaPlayer(13811): stop()in
07-1413:23:02.779: D/MediaPlayer(13811): stop() out
07-1413:23:02.779: D/MediaPlayer(13811): release()in
07-1413:23:02.789: D/MediaPlayer(13811): release() out
07-1413:23:02.799: E/libEGL(13811): call to OpenGL ES API with no current context (logged once per thread)
07-1413:23:02.919: D/WindowManagerImpl(13811): finishRemoveViewLocked, mViews[0]: com.android.internal.policy.impl.PhoneWindow$DecorView@4052b010
Sussed it ! Maybe add this somewhere in the documentation.
i added this to my main.lua.
require"notification"
BUT!. it creates a notification on my phone, which opens the game, which is great. but i really wanted like an android "toast" command, so i can inform the user, of a payment accepted etc
@ArtLeeApps yes well every plugin needs to be required thus I thought it's understandable :-\"
About toast notifications, well it's not possible, not currently, notification managing was standardized to match both IOS and Android and since IOS does not have toast notification, I would suggest using something from Gideros itself, like AlertDialog or your own implementation, for example like used here: http://www.giderosmobile.com/forum/discussion/3147/achievements#Item_1
But if you want, you can change a plugin code a bit to launch toast instead of notification when dispatching event now (without delaying). In NotificationClass.java find function public static void dispatchNow(int id) And change it to something like:
publicstaticvoid dispatchNow(int id){if(mBuilders.get(id)!=null){
GNotification mBuilder = mBuilders.get(id);// set text to showfinalString text = mBuilder.message;//set duration of toastfinalint duration = Toast.LENGTH_SHORT;
sActivity.get().runOnUiThread(newRunnable(){publicvoid run(){//create toast object
Toast toast = Toast.makeText(sActivity.get(), text, duration);//show it
toast.show();}});}}
I have a question about NotificationManager:getPushNotifications and clearPushNotifications.
getPushNotifications docs say: "You must provide an ID on the server to identify your push notification in this list."
Does that mean you will get push notifications from other apps here and somehow I have to go thought them and see if some are for my app?
clearPushNotifications docs say: "Clears the data about received push notifications that can be retrieved using NotificationManager:getPushNotifications method."
Do I have to call this method once I have read the notifications? What exactly will it do?
Comments
ps: i Love the new docs interface
http://www.nightspade.com
If you will also one day make google map plugin Gideros will have everything that i needed from it for my new project
Likes: SinisterSoft
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Copy pasting
Can we write it off to a practical joke on 1st of April?
Edit 2: App only works if it is run on phone through Eclispe(run -> choose devices connected by adb). The app still "crashes" if I do a regular packaging of the app. Do I have to use a key other than the default debug key?
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
I think you should have been able to use so files without jni source (without compiling your own so files)
And about what debug key are you talking?
https://deluxepixel.com
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
So you want to say that all works when you run app from eclipse, but not when you export the app?
For the debug file, the "PushNotificationController" is just a lua file I have that controls all notifications. I have attached is as PushNotificationController.txt. Feel free to just make it a .lua to examine where the error occurs.
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
Probably need to state that somewhere in the docs, about requiring
https://deluxepixel.com
NotificationManager Event.LOCAL_NOTIFICATION
NotificationManager Event.PUSH_NOTIFICATION
NotificationManager Event.PUSH_REGISTRATION
NotificationManager Event.PUSH_REGISTRATION_ERROR
There should be an ON_ prefixing all those. Text also needs to be updated in the code examples for each of those doc sections.
NotificationClass.mm line 44
+[NotificationClass deinitialize]
I've updated the repo, renamed events correctly for consistency (removed ON_) for both IOS and Android, and also changed example Gideros project.
About the crash you were, having, well I haven't experienced anything like that, but that specific call, actually was not required, all the contents being released in previous loop and object being auto released, thus I just removed it.
Let me know if that works now
Im trying to plug in the Notification stuff.
i thought i had it all in place.
Exported to Eclipse, but when i attempt to run this bit:
---------------------------
http://artleeapps.com/
Bubble Adventure - Colors
Sussed it !
Maybe add this somewhere in the documentation.
i added this to my main.lua.
BUT!.
it creates a notification on my phone, which opens the game, which is great. but i really wanted like an android "toast" command, so i can inform the user, of a payment accepted etc
is there such a thing ?
http://artleeapps.com/
Bubble Adventure - Colors
About toast notifications, well it's not possible, not currently, notification managing was standardized to match both IOS and Android and since IOS does not have toast notification, I would suggest using something from Gideros itself, like AlertDialog or your own implementation, for example like used here:
http://www.giderosmobile.com/forum/discussion/3147/achievements#Item_1
But if you want, you can change a plugin code a bit to launch toast instead of notification when dispatching event now (without delaying).
In NotificationClass.java find function public static void dispatchNow(int id)
And change it to something like:
thank you. So i suppose i should do a dialog, that way if i create a ios version, they will work in a similar way. Even though i still like toast :-)
http://artleeapps.com/
Bubble Adventure - Colors
I used the notification example project and simply added second table for one of the notifications.
note:dispatchAfter({sec = 5}, {sec = 10})
Thank you for creating the plugins!
I have a question about NotificationManager:getPushNotifications and clearPushNotifications.
getPushNotifications docs say: "You must provide an ID on the server to identify your push notification in this list."
Does that mean you will get push notifications from other apps here and somehow I have to go thought them and see if some are for my app?
clearPushNotifications docs say: "Clears the data about received push notifications that can be retrieved using NotificationManager:getPushNotifications method."
Do I have to call this method once I have read the notifications?
What exactly will it do?
Thanks
Vlad