• 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 /
  • Help Room /
avatar image
0
Question by NCPLNaveen · Mar 21, 2016 at 01:08 PM · c#remotenotificationservices

How to Schedule a Remote Notification daily at certain time.

Hello Everyone, From past 1 week im trying to find out about how to sent Remote Notifications to the ios and android using C# and Onesignal or else another service , when the game is not running in back ground or when game is not opened at all(just installed). I have searched everywhere but i didnt found answer. Thank you

Comment
Add comment · Show 2
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 taxvi · Mar 21, 2016 at 01:15 PM 0
Share

so you have followed THIS guide, you have followed THIS guide all step by step and still nothing happens?

avatar image NCPLNaveen · Mar 21, 2016 at 01:22 PM 0
Share

Hey @ taxvi, I have already implemented every thing what you have shown . But what i want is when game is not running , i mean just installed. I should get a notification. Thank you

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by brain56 · Mar 21, 2016 at 01:31 PM

What you want to implement are called push notifications. For iOS, you can follow the documentation guide. For Android, there is currently no out-of-the-box solution for implementing push notifications as different Android devices use different systems (e.g. Google's GCM vs Amazon's ADM). There are existing plug-ins for this, one example is UTNotifications.

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
avatar image
0

Answer by Yuriy-Ivanov · Mar 21, 2016 at 01:50 PM

Hi NCPLNaveen,

As far as I can say from your question, you don't even need to use push (remote) notifications: just scheduled local ones are enough (and it's much easier to implement local notifications). Both local and push notifications are designed to be delivered even if your app is not running (but it has to be run at least once by user, it's a requirement of operating systems). Unity, as brain56 correctly mentioned, provides notifications API only on iOS. For other platforms there is a number of plugins at unity asset store, f.e. our asset, mentioned by brain56 - UTNotifications (it supports both local and push notifications on iOS, Android, Amazon Android & WP).

Best regards, Yuriy, Universal Tools team.

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
avatar image
0

Answer by JuPPa · Jul 16, 2020 at 10:28 AM

Hello, could you please provide with a basic script on how to activate daily notifications? Because on my app the push notifications are appearing EXCLUSIVELY when the app is being used. but it is annoying like this, and it is also pretty useless. I simply would like to remind my users to use my app DAILY, especially when they are NOT using it.

Thanks a lot to anyone willing to help me out :)

this is my script.

*using System.Collections;

using System.Collections.Generic;

using Unity.Notifications.Android;

using UnityEngine;

public class NotificationsManagerAndroid : MonoBehaviour

{

 public AndroidNotificationChannel defaultNotificationChannel;

 int identifier;

 void Start()

 {

     var defaultNotificationChannel = new AndroidNotificationChannel()

     {

         Id = "default_channel",

         Name = "Default Channel",

         Importance = Importance.Default,
         Description = "For Generic notifications",
     };
     AndroidNotificationCenter.RegisterNotificationChannel(defaultNotificationChannel);
     AndroidNotification notification = new AndroidNotification()
     {
         Title = "Thirsty Glass!",
         Text = "I am thirsty!",
         SmallIcon = "main_icon",
         LargeIcon = "app_icon_large",
         FireTime = System.DateTime.Now.AddSeconds(10), //.AddMinutes
     };
     identifier = AndroidNotificationCenter.SendNotification(notification, "default_channel");
     AndroidNotificationCenter.NotificationReceivedCallback receivedNotificationHandler = delegate (AndroidNotificationIntentData data)
     {
         var msg = "Notification received : " + data.Id + "\n";
         msg += "\n Notification received: ";
         msg += "\n .Title: " + data.Notification.Title;
         msg += "\n .Body: " + data.Notification.Text;
         msg += "\n .Channel: " + data.Channel;
         Debug.Log(msg);
     };
     AndroidNotificationCenter.OnNotificationReceived += receivedNotificationHandler;
     var notificationIntentData = AndroidNotificationCenter.GetLastNotificationIntent();
     if (notificationIntentData != null)
     {
         Debug.Log("App was opened with notification!");
     }
 }
 private void OnApplicationPause(bool pause)
 {
     if (AndroidNotificationCenter.CheckScheduledNotificationStatus(identifier) == NotificationStatus.Scheduled)
     {
         //If the player has left the game and the game is not running. Send them a new notification
         AndroidNotification newNotification = new AndroidNotification()
         {
             Title = "Reminder Notification!",
             Text = "You've paused the game!",
             SmallIcon = "main_icon",
             LargeIcon = "app_icon_large",
             FireTime = System.DateTime.Now
         };
         // Replace the currently scheduled notification with a new notification.
         AndroidNotificationCenter.UpdateScheduledNotification(identifier, newNotification, "default_channel");
     }
     else if (AndroidNotificationCenter.CheckScheduledNotificationStatus(identifier) == NotificationStatus.Delivered)
     {
         //Remove the notification from the status bar
         AndroidNotificationCenter.CancelNotification(identifier);
     }
     else if (AndroidNotificationCenter.CheckScheduledNotificationStatus(identifier) == NotificationStatus.Unknown)
     {
         AndroidNotification notification = new AndroidNotification()
         {
             Title = "Thirsty Glass!",
             Text = "I am thirsty!",
             SmallIcon = "main_icon",
             LargeIcon = "app_icon_large",
             FireTime = System.DateTime.Now.AddSeconds(10),
         };
         //Try sending it again
         identifier = AndroidNotificationCenter.SendNotification(notification, "default_channel");
     }
 }

}*

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

129 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 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 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 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 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 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

Change hierarchy | remove any assets in remote addressable 0 Answers

Unity Remote: Project does not work 100% on Mac but works 100% in Windows 1 Answer

How to cancel iOS LocalNotification? 1 Answer

local notification scheduling for every one hour. 0 Answers

Disable/Enable Firebase Notifications 0 Answers


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