小编Goo*_*ian的帖子

以编程方式在Android上安装应用程序

我很想知道是否可以从自定义Android应用程序以编程方式安装动态下载的apk.

android apk

200
推荐指数
10
解决办法
17万
查看次数

如何使用 Capacitor 在 Android Native App 中获取 Angular Push Notification?

我正在开发 Angular 渐进式 Web 应用程序,当我使用ng serve它运行应用程序时,它在浏览器中运行良好,并在 Service Worker 上提供后台通知。

但相同的功能不适用于使用 Capacitor 构建工具创建的移动应用程序npx cap add android

我的firebase-service-worker.js文件:

importScripts('https://www.gstatic.com/firebasejs/5.5.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/5.5.0/firebase-messaging.js');

firebase.initializeApp({
  'messagingSenderId': '65358642427'
});

const messaging = firebase.messaging();

messaging.setBackgroundMessageHandler(function (payload) {

  var notificationTitle = JSON.parse(payload.notification).title;
  var notificationOptions = {
    body: JSON.parse(payload.notification).body
  };

  return self.registration.showNotification(notificationTitle, notificationOptions);
});
Run Code Online (Sandbox Code Playgroud)

push-notification firebase progressive-web-apps angular capacitor

3
推荐指数
1
解决办法
1724
查看次数

Laravel Mail::raw 自定义变量

我有这个片段,它使用我在 env 中设置的邮件枪 API 发送电子邮件。它全部发送,但我现在想从用户那里选择变量,并根据输入设置一些其他信息

$name       =  $request->name;
$name2      =  'hello';
$email      =  $request->email;
$message    =  $request->message;

Mail::raw($message, function($message)
{
    $message->from('hello@hello.com', 'In-app Correspondence By -- ')->subject('Welcome!');
    $message->to('pr@example.com')->cc('me@gmail.com');
});
Run Code Online (Sandbox Code Playgroud)

问题是当我输入时$message->to($email)->cc('me@gmail.com');会出现内部服务器错误,但上面的代码工作正常。

电子邮件没问题,我检查过,但确实存在。我还想对消息进行回复并插入 $email 变量。到目前为止,回复甚至将 $email 放在该主题上都会导致内部服务器错误。

可能是什么问题。

php laravel

1
推荐指数
1
解决办法
1406
查看次数