Einzelnen Beitrag anzeigen

Anakond

Registriert seit: 13. Okt 2007
23 Beiträge
 
#1

Android Notification und Sound startet nicht.

  Alt 13. Nov 2019, 15:22
Guten Tag,

Ich arbeitete mit der SDK Version 24.3.3.32 bit,
die Notification und der sound funktionierte einwandfrei.

Im AndroidManifest stand:
Code:
 uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"
Jetzt um eine neue Applikation auf Play Store zu aktievieren verlangt die Play Console dass man
die API Level 28 haben soll.

Ich habe jetzt dann die SDK version 25.2.5 installiert mit API Level 28,
mit dieser Einstellung bekomme ich keine Notification und kein Sound mehr auf mein Android Smartphone.

Im AndroidManifest stand:
Code:
uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28"
Wenn ich MyNotification.SoundName weg nehme, also der Default Sound, alles funktioniert einwandfrei.

Code:
procedure TForm1.Button4Click(Sender: TObject);
var
  MyNotification: TNotification;
begin
  MyNotification := NotificationCenter1.CreateNotification;
  try
    MyNotification.Name := 'MyNotification';
    MyNotification.AlertBody := 'Delphi test';

    MyNotification.EnableSound := True;
    MyNotification.SoundName := TPath.Combine(TPath.GetPublicPath, 'MySound.mp3');
    // deloyment assets\

    MyNotification.FireDate := Now;
    NotificationCenter1.ScheduleNotification(MyNotification);
  finally
    MyNotification.Free;
  end;

end;
Was kann ich tun, um mein eigenen Sound wieder abspielen zu lassen.

Vielen Dank für ihre Bemühungen und Ihre Unterstützung.
  Mit Zitat antworten Zitat