![](/img/trans.png)
[英]Please, how I can get with FireMonkey if screen is on or off on iOS device?
[英]How can I get firemonkey to display a local notification on iOS?
我从Embarcadero网站(此处)提取了以下代码以生成本地通知。
procedure TForm1.SetNumberClick(Sender: TObject);
var
MyNotification: TNotification;
begin
// Create an instance of TNotification
MyNotification := NotificationCenter1.CreateNotification;
try
MyNotification.Number :=18;
MyNotification.AlertBody := 'Delphi for your mobile device is here!';
NotificationCenter1.PresentNotification(MyNotification);
finally
MyNotification.DisposeOf;
end;
end;
它编译并运行。 不出所料,我确实必须在表单上将NotificationCenter1创建为TNotificationCenter。 它可以在Android下找到,但是在iOS下却可以看到butkus。 没有本地通知,没有图标图标,甚至没有错误。
它曾经在XE8下工作吗?
XE8和10 / Seattle之间的本地通知是否有所更改?
我的手机正在运行iOS 9.2。 iOS在8.x和9.x之间进行了某些更改,从而中断了Firemonkey的本地通知吗?
最终的解决方案有两个方面:
FMLocalNotificationPermission
设置为true(项目->选项->版本信息)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.