flutter_local_notifications:^11.0.0
我使用了这个库,但我可以找到 IOSInitializationSettings 请帮助我。我正在尝试将推送通知集成到我的 flutter 应用程序中。
我尝试了很多代码来在 android 11 或 12 中获取 pdf 路径,但仅适用于 android 10 或更低的设备。你能帮我么?我分享我的行代码
像这样的意图调用
Intent intent = new Intent();
intent.setType("application/pdf");
statusAdapter = "pdf";
pos = position;
intent.setAction(Intent.ACTION_GET_CONTENT);
someActivityResultLauncher.launch(Intent.createChooser(intent, "Select PDF"));
Run Code Online (Sandbox Code Playgroud)
someActivityResultLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {
if (result.getResultCode() == Activity.RESULT_OK) {
// There are no request codes
Intent data = result.getData();
if (data == null) {
//error
return;
}
try {
final Uri pdfUri= data.getData();
File pdfFile = new File(getPath(pdfUri));
long length = pdfFile.length();
length = length / 1024;
Toast.makeText(CreateSubEventActivity.this, …Run Code Online (Sandbox Code Playgroud)