B4A Library Notification Builder Library.

barx

Well-Known Member
Licensed User
Longtime User
I hadn't seen the euro sign issue, oops. So, when is this happening? where are you trying to insert the euro sign. Maybe escape it as such by using chr

wow, i just noticed I have no euro key on my keyboard, is my laptop really that old???
 

Malky

Active Member
Licensed User
Longtime User
Hi Barx, I need to add in notifications on my app such as Bargain at €5 or something?

If I post a message with just 5 it's ok, if I put €5, it screws up and a blank variable.

The php file which returns the data, is set to charset UTF-8

I am Scottish, working/living in Bulgaria with a brand new keyboard and there is no pound sign? I have to copy it and paste at times. Don't give up

Shower and film, been a long day.

Malky
 

barx

Well-Known Member
Licensed User
Longtime User
hmmm, can you try the demo app and see if you experience the same issue, I just tried inserting a euro sign in the title in the demo app and all seemed ok, maybe it is an issue with the passed string?
 

Malky

Active Member
Licensed User
Longtime User
Hi Bart, thanks for the prompt reply. I will check out the php return variable later and will definitely post results.

Maybe I need to encode the result?

Had my shower, but if I don't go upstairs now for the film, you will hear no more

Cheers,

Malky
 

barx

Well-Known Member
Licensed User
Longtime User
no worries malky. log the php returned string. See what it brings.

Enjoy your film buddy.
 

Malky

Active Member
Licensed User
Longtime User
Ok, problem solved and I now have the euro sign.

PHP response below.

B4X:
$response = sendNotification(
            $apiKey,
            array($registrationId),
            array('message' => mysql_real_escape_string(urldecode($message)), 'tickerText' => $tickerText, 'contentTitle' => $contentTitle, 'contentText' => iconv("Windows-1252","UTF-8",$contentText) ));

Took a while and I dare say some other conversions would work, but hey? I have it working, it's now 00:52 and maybe I should be in bed?

Thanks very much for the input guys, always great to know someone can help or inspire you.

Malky
 

lte5000

Member
Licensed User
Longtime User
I have hopefully added the required method to the lib. If you download and install the v2.31 file from the original post

I hope it works for you, let me know how you get on.

barx, I downloaded the new version and am using SetDeleteService, it works like a charm!
No activity shows when the delete service is called... perfect!
I will continue to test and let you know if I discover any problems.

Thank you very much for your work!
 

barx

Well-Known Member
Licensed User
Longtime User

PhillipMorris

Member
Licensed User
Longtime User
Hello, is it possible to use the notificationbuilder as the standard android.app.Notification ?
I want to use it in Service.StartForeground(1, nb).
Thanks.
 

barx

Well-Known Member
Licensed User
Longtime User
Hi Phillip,

See the GetNotification method, available since v2.2. Build you notification with notification as usual and then use GetNotifcation to pass the notification object to the foreground service.
 

PhillipMorris

Member
Licensed User
Longtime User
It worked like a charm. Thanks for your help.
Another question. How do I refresh a string added by nbInboxStyle.AddLine ?
 

barx

Well-Known Member
Licensed User
Longtime User
It worked like a charm. Thanks for your help.
Another question. How do I refresh a string added by nbInboxStyle.AddLine ?

I think was asked before Phillip but I don't have time to read through the full thread right now.

Not tested, but I think you would have to initialize a new inboxStyle, set it up as usual. Add it to the notification as usual and the notify(with the same ID) again. If that makes sense.
 

dibesw

Active Member
Licensed User
Longtime User
HI,
I have this error when compile:



android-support-v4.jar there is in library
Code is:

B4X:
Sub btnCreateNotifications_Click
    Dim cn As NotificationBuilder
    Dim bigpic As NotificationBigPictureStyle
    cn.SmallIcon = "icon"
   
    cn.Ticker = "News dallo studio dentistico"
    cn.DefaultLight = True
    cn.DefaultVibrate = False
    cn.DefaultSound = False

    cn.ContentTitle = "Offerta prima delle vacanze"
    cn.ContentText = "Ablanzione tartaro: 30€"
    cn.ContentInfo = "Info"
    cn.SubText = "Approfittane fino al 31/06/2014"
    Dim BigPict As Bitmap
    BigPict.Initialize(File.DirAssets,"nyc.jpg")
    bigpic.BigContentTitle = "Solo da noi"
    bigpic.SummaryText = "Chiedi informazioni..."
    bigpic.BigPicture = BigPict
    cn.SetStyle(bigpic)
    cn.Notify(1)
End Sub

Can help me someone?
THANKS!
 

walterf25

Expert
Licensed User
Longtime User
I believe you need to update that android-support-v4.jar file, go to your android sdk folder and run the sdk manager, and update your files.
Hope this solves your problem.
 

dibesw

Active Member
Licensed User
Longtime User
Hi walterf25,
I have run SDK Manager in android-sdk-windows but I haven't find android-support-v4.jar file in any folder.
I have also moved my android-support-v4jar in another forder but I have seen that this file is not moved.
Where is this file?
Can I download from any from somewhere?
 

walterf25

Expert
Licensed User
Longtime User
You will find the file in C:\android\sdk\extras\android\support folder, note that your path may vary depending on where you placed the android sdk, but if you go to your folder, then go to extras folder then android folder and then support folder.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…