Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added BigStyle (BicPictureStyle and BigTextStyle) #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Clebal
Copy link

@Clebal Clebal commented Sep 17, 2017

I've added BigStyle options to Android Notifications as I did in Fuse.PushNotifications.

I've created four variables that are sent from backend:

  • bigTitle
  • bigBody
  • notificationStyle (It can be bigpicturestyle or bigtextstyle)
  • featured_image (URL of the Image that you want to use)

@oscarcge
Copy link

oscarcge commented Sep 25, 2017

I couldn't compile until I added "Android/ImageDownloaderTask.java:Java:android" to Firebase.Notifications.Android.unoproj.

How can I view the bigpicturestyle or bigtextstyle notification? I received the same way I did without modify the app.

How do I have to structure my notification. this is the way I have structured my notification:


{ 
	"data": { 
		"notification": { 
			"alert": { 
				"icon": "assets/thing.png",
				"bigTitle": "notification title",
				"bigBody": "the body of the notification",
				"featured_image ": "http://mydomain.com/image.png",
				"notificationStyle": "BigTextStyle"
			} 	
		}, 	
	}, 
	
	"to" : "d6MCUaxl41U:........_guDVvbIFi" 
	
}

@Clebal
Copy link
Author

Clebal commented Sep 26, 2017

@oscarcge Hello, I've forgotten to push Firebase.Notifications.Android.unoproj. I've update this pull request with all the last things I've done. You've got an error in your JSON:

body: JSON.stringify({
                registration_ids: [regID],
                data: {
                    title: 'Well would ya look at that!',
                    body: 'Hello from some other app',
                    whatever: 'anything you like'
                }
            })

You can write data or notification inside body. But the structure you wrote is for Fuse.PushNotifications. Another thing, Title and Body properties are obligatory. bigTitle, bigBody, featuredImage (I've changed featured_image to featuredImage, every name in the same style) and notificationStyle are all optionals.

bigTitle and bigBody are the title and body that appears when you dropdown the notification with your fingers.

Last thing, notificationStyle can be "bigtextstyle" or "bigpicturestyle", all lower case to avoid error with the capitalize letters.

In this update, I've improve the BigPictureStyle, you can now use a bundled images like you do in icon property.

I hope it helps you, if it doesn't work, let me know.

@oscarcge
Copy link

oscarcge commented Sep 26, 2017

Hi Clebal, now it's working!!!!!

The problem was the structure of the data as you mentioned.

This is my new structure:

{
    "registration_ids": ["regID"],
    "data": {
        "title": "Well would ya look at that!",
        "body": "Hello from some other app",
        "bigTitle": "Big title notification title",
	"bigBody": "Big body text from some other app.",
	"featuredImage": http://mydomain.com/image.png",
        "notificationStyle": "bigpicturestyle"
    }
 }

Can i subscribe users to topics with Fuse.Firebase? if yes, how can i do that?
Thank you for taking your time to help me, i really appreciate it :)

@Clebal
Copy link
Author

Clebal commented Sep 26, 2017

@oscarcge I don't know if I understood you, but I'll try to answer your question. If you mean that you want to send notifications to a specific group of user that are subscribed to a topic, in your backend you should manage differents regID arrays that contains the subscribed user's ID. If you have Topic1 and Topic2, you should save two arrays regIDTopic1 and regIDTopic2, when a user suscribes to the topic, you should send the ID to the backend and save it in the specific array, and when you send the notifications, in registration_ids, you should put the specific array which contains the subscribed users' ID to that topic.

@oscarcge
Copy link

@Clebal that's the way I was thinking implement it, I thought there were another way. Thanks for reply.

@oscarcge
Copy link

oscarcge commented Oct 3, 2017

Hi @Clebal, it's me again :)

Is there a way to put icons in the notification like twitter do with specific actions with this library. check the example below.
image

@Clebal
Copy link
Author

Clebal commented Oct 3, 2017

Hello @oscarcge, that is a custom notifications, it means that it's not a native option that Android offers, it's made using a custom view to create the notification. For that, you've to add java code. I've never made something like that in Fuse, I think it's possible but I can't help you more.

https://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomNotification

@oscarcge
Copy link

oscarcge commented Oct 3, 2017

@Clebal Thanks again for the help, this is the information I was looking for.

@LuisRodriguezLD
Copy link
Member

I want to merge this, can you confirm it is still working @jesusmartinoza?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants