AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Cross-Platform-Entwicklung Notifications mit individuellem Sound
Thema durchsuchen
Ansicht
Themen-Optionen

Notifications mit individuellem Sound

Ein Thema von bcvs · begonnen am 8. Mär 2024 · letzter Beitrag vom 29. Jun 2024
 
Kai_in_HH

Registriert seit: 25. Jun 2008
Ort: Hamburg
59 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: Notifications mit individuellem Sound

  Alt 9. Mai 2024, 21:26
Verdammte Axt, ich habe das gleiche Problem.

Ich stelle in assets\internal\ meine eigene mp3 bereit, sie wird aber nicht als Notification-Ton verwendet. Es kommt immer nur der Standard-Ton.

Hier mein Code
Code:
procedure TForm1.PresentNotificationClick(Sender: TObject);
var
  MyNotification: TNotification;
begin
  MyNotification := NotificationCenter1.CreateNotification;
  try
    MyNotification.Name := 'BikeAppNotification';
    MyNotification.AlertBody := 'BikeApp Notification';
    MyNotification.FireDate := Now;
    MyNotification.EnableSound := True;
    MyNotification.SoundName := TPath.Combine(ProgDir, 'bell.mp3');;
    NotificationCenter1.PresentNotification(MyNotification);
  finally
    MyNotification.DisposeOf;
  end;
end;
ProgDir wird in einer anderen Funktion so ermittelt und funktioniert z.B. auch einwandfrei für die Arbeit mit meiner SQLLite-DB, daran kanns also nicht liegen

Code:
 ProgDir := TPath.GetDocumentsPath;
Also das ist nach allen Anleitungen eigentlich der richtige Weg. Interessiert nur meine App (oder den Delphi-Compiler?) nicht.

Kai
Kai
formerly known as linus_wildcat
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz