Files
UnrealEngineUWP/Engine/Source/Runtime/Android/AndroidLocalNotification/Public/AndroidLocalNotification.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

64 lines
2.9 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
AndroidLocalNotification.h: Unreal Android local notification interface object.
=============================================================================*/
#pragma once
#include "LocalNotification.h"
#if PLATFORM_ANDROID
#include "Android/AndroidJNI.h"
#include "Android/AndroidApplication.h"
#include <android_native_app_glue.h>
#endif
#include "Runtime/Core/Public/Modules/ModuleManager.h"
DECLARE_LOG_CATEGORY_EXTERN(LogAndroidLocalNotification, Log, All);
/**
* AndroidLocalNotification implementation of an Unreal local notification service.
*/
class FAndroidLocalNotificationService : public ILocalNotificationService
{
public:
FAndroidLocalNotificationService();
/** Clear all pending local notifications. Typically this will be done before scheduling new notifications when going into the background */
virtual void ClearAllLocalNotifications();
/** Schedule a local notification at a specific time, inLocalTime specifies the current local time or if UTC time should be used
* @param FireDateTime The time at which to fire the local notification
* @param LocalTime If true the provided time is in the local timezone, if false it is in UTC
* @param Title The title of the notification
* @param Body The more detailed description of the notification
* @param Action The text to be displayed on the slider controller
* @param ActivationEvent A string that is passed in the delegate callback when the app is brought into the foreground from the user activating the notification
*/
virtual void ScheduleLocalNotificationAtTime(const FDateTime& FireDateTime, bool LocalTime, const FText& Title, const FText& Body, const FText& Action, const FString& ActivationEvent);
/** Get the local notification that was used to launch the app
* @param NotificationLaunchedApp Return true if a notification was used to launch the app
* @param ActivationEvent Returns the name of the ActivationEvent if a notification was used to launch the app
* @param FireDate Returns the time the notification was activated
*/
virtual void GetLaunchNotification(bool& NotificationLaunchedApp, FString& ActivationEvent, int32& FireDate);
/** Set the local notification that was used to launch the app
* @param ActivationEvent Returns the name of the ActivationEvent if a notification was used to launch the app
* @param FireDate Returns the time the notification was activated
*/
virtual void SetLaunchNotification(FString const& ActivationEvent, int32 FireDate);
/** Cancel a local notification given the ActivationEvent
* @param ActivationEvent The string passed into the Schedule call for the notification to be cancelled
*/
virtual void CancelLocalNotification(const FString& ActivationEvent);
private:
bool AppLaunchedWithNotification;
FString LaunchNotificationActivationEvent;
int32 LaunchNotificationFireDate;
};