I am attempting to save a video to the PhotoLibrary on an iPhone. When I run the app on an actual iPhone and debug with Xcode, I receive the following error:
could not cast value of type ‘__nsdictionarym’ to ‘nsstring’
This occurs when the following line is called in the saveVideo function of the PhotoLibrary.swift class:
let url = command.arguments[0] as! String
And the following is the Typescript used to create the call to the saveVideo function where ‘file’ is of the form ‘www.example.com/test.mp4’:
this.photoLibrary.requestAuthorization({}).then(
response => {
this.photoLibrary.saveVideo(file,"Test Videos");
}
);
Any help would be much appreciated. Does my ‘file’ variable need to be of a different format?