小编Der*_*ard的帖子

Nodemailer:从未收到过问候

当尝试使用 Nodemailer ( https://github.com/nodemailer/nodemailer )在 Node 内发送电子邮件时,与 Ethereal 测试电子邮件帐户结合使用时sendMail,对 Nodemailer 传输器的调用会引发错误Greeting never received

我尝试使用“回调方法”和“异步/等待”方法,但在这两种情况下都会引发相同的错误。这两个示例都非常直接来自 Nodemailer 文档中的工作示例。也许我错过了一些简单的东西?:)

这是产生错误的“回调方法”代码:

it('can send email with a dynamic test account', done => {
    nodemailer.createTestAccount((err, account) => {
        const transporter = nodemailer.createTransport({
            host: 'smtp.ethereal.email',
            port: 587,
            auth: {
                user: account.user, // generated ethereal user
                pass: account.pass // generated ethereal password
            }
        });

        const mailOptions = {
            from: '"Fred Foo " <foo@example.com>', // sender address
            to: 'bar@example.com, baz@example.com', // list of receivers
            subject: …
Run Code Online (Sandbox Code Playgroud)

javascript email node.js npm

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

使用Xamarin iOS应用程序中的UIApplicationDelegate.DidReceiveRemoteNotification处理远程通知

我有一个配置为接收远程通知的Xamarin iOS应用程序.当设备收到远程通知时,远程通知处理程序未按预期执行.

DidReceiveRemoteNotification的实现包括对应用程序的引用,通知用户信息字典以及使用适当的UIBackgroundFetchResult状态执行的完成处理程序.

    public override void DidReceiveRemoteNotification (UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
    {
        // retrieve something from a server somewhere
    }
Run Code Online (Sandbox Code Playgroud)

根据Apple的iOS开发人员文档,在向用户显示远程通知后,将执行'application:didReceiveRemoteNotification:fetchCompletionHandler'.

这包括应用程序处于运行状态,后台运行状态以及"未运行"状态.接收通知应启动应用程序,然后在调用此方法之前将其置于后台状态.

参考:https: //developer.apple.com/library/ios/documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html#jumpTo_12

在我的设备上运行时,远程通知已成功传递.但是,在XCode Organizer中跟踪设备的控制台日志时,应用程序永远不会启动,并且永远不会执行"DidReceiveRemoteNotification"方法.

我做了以下事情:

  • 选中"启用后台模式"并在应用程序的plist文件中启用"后台获取"和"远程通知".
  • 在我的应用程序委托中实现了DidReceiveRemoteNotification(UIApplication,NSDictionary,Action).
  • 确保发送到APN的通知配置为标准通知 - 即不是静默通知.
  • 在不同状态(前台,后台,未运行等)运行应用程序时,向我的设备发送测试远程通知.

如果这个线程是正确的,这看起来像Xamarin实现中的一个问题,但我希望其他人之前遇到过这个问题,并且可以确认或提供其他信息. http://forums.xamarin.com/discussion/8765/handling-silent-remote-notifications

c# xamarin.ios ios xamarin

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

标签 统计

c# ×1

email ×1

ios ×1

javascript ×1

node.js ×1

npm ×1

xamarin ×1

xamarin.ios ×1