Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Xtro · Jul 17, 2014 at 05:53 PM · androidnotification

[Android, GCM] How to display notification when receiving the message from our server?

Hi,

For android version of push notification, I used this unity plugin for GCM : https://github.com/kskkbys/unity-gcm

It works quite well. I can receive the messages from our server and display an in-app notification. That's ok but I want an android notification to be displayed (just like push notification on ios) when the app is in background.

I'm new on android development so I don't even know if there is a built-in notification system in android. I tried to talk to the author of the plugin but he didn't reply my emails.

Is it possible to display a notification when the app is in background?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Xtro · Jul 18, 2014 at 03:03 PM 0
Share

I have to bump this question up :(

avatar image Xtro · Jul 21, 2014 at 07:43 PM 0
Share

Another bump :(

avatar image dhruvparmar · Jun 17, 2016 at 03:55 PM 0
Share

Can work FC$$anonymous$$ ins$$anonymous$$d of GC$$anonymous$$ in Unity 3d? If work then what plugin required to build.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Xtro · Jul 23, 2014 at 03:34 PM

I will use this addon for solving my problem :

https://www.assetstore.unity3d.com/en/#!/content/9484

Edit : This addon didn't solve my problem completely. It does what is supposed to. It can show the notification in the notification center. The problem is, I still can't trigger this notification when the app is in background because I can't receive the GCM message when it's in background. Currently, I can receive the GCM message and I can show a notification when only the app is in foreground :( :(

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vijayrathore99 · Jun 04, 2015 at 09:40 AM 0
Share

Thanks for push Notification it is working. According to this link https://github.com/kskkbys/unity-gcm. I follow this link tutorial.Push Notification in android working fine. But there is problem in the background mode or when application is not active push notification is not receive, In GC$$anonymous$$Receiver.cs file there is method which will call when notification come.

void On$$anonymous$$essage (string message) { Debug.Log ("$$anonymous$$essage: " + message); Debug.LogError ("!!!!!!!!!!!!!!!!!!!!!!!! "+message); if (_on$$anonymous$$essage != null) { Dictionary table = $$anonymous$$iniJSON.Json.Deserialize (message) as Dictionary ; _on$$anonymous$$essage (table); } }

but this method is not calling in background mode.

avatar image
1

Answer by Voxel-Busters · Aug 11, 2015 at 11:22 AM

Yes it's possible to have notifications triggered and shown in notification bar when your app is in background or when it is not running.

However, if you are expecting notification to be shown in the notification bar even if your app is in foreground, thats not a recommended way.

Here is our plugin which solves this issue. Cross Platform Native Plugins provides an unified access to use Local and Push notifications on iOS and Android with same lines of code(unified API). It has many other features (In-App purchases, Webview, Leaderboards & Achievements (coming soon) and more). Here is what notifications feature can do

  1. Supports both Local and Remote Notifications.

  2. Repeat Local Notifications for a time Interval

  3. Customize the Keys you want to send in the payload

  4. Custom Large Icon, Sound allowed

  5. Support for setting small White icon on > 5.0 devices

  6. Receive Launched start up notification

  7. Receive notifications when in background or when app is not running

alt text

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android notification issue 0 Answers

Opening android notification setting menu from my app? 0 Answers

White notification icon - Android 5.0 Lollipop 7 Answers

Remote notification on Android, when the game is not run in background. -1 Answers

Repeat notification android 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges