evanshortiss / sns-mobile

Push notifications to Android, Kindle, and iOS devices easily using this module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid parameter: JSON must contain an entry for 'default' or 'APNS_SANDBOX'.

jtmarmon opened this issue · comments

Any idea why I might be getting this? (more info below)

2015-03-19 20:40:02 - error: ! Error: Invalid parameter: JSON must contain an entry for 'default' or 'APNS_SANDBOX'.
2015-03-19 20:40:02 - error: !     at Request.extractError (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/service_interface/query.js:61:35)
2015-03-19 20:40:02 - error: !     at Request.callListeners (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/sequential_executor.js:132:20)
2015-03-19 20:40:02 - error: !     at Request.callListeners (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/sequential_executor.js:133:16)
2015-03-19 20:40:02 - error: !     at Request.emit (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/sequential_executor.js:100:10)
2015-03-19 20:40:02 - error: !     at Request.emitEvent (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/request.js:536:10)
2015-03-19 20:40:02 - error: !     at Request.emitEvents (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/request.js:510:12)
2015-03-19 20:40:02 - error: !     at Request.completeRequest (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/request.js:480:10)
2015-03-19 20:40:02 - error: !     at Request.HTTP_DONE (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/event_listeners.js:230:12)
2015-03-19 20:40:02 - error: !     at Request.callListeners (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/sequential_executor.js:132:20)
2015-03-19 20:40:02 - error: !     at Request.emit (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/sequential_executor.js:100:10)
2015-03-19 20:40:02 - error: !     at Request.emitEvent (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/request.js:536:10)
2015-03-19 20:40:02 - error: !     at IncomingMessage.onEnd (/src/node_modules/sns-mobile/node_modules/aws-sdk/lib/event_listeners.js:190:26)
2015-03-19 20:40:02 - error: !     at IncomingMessage.emit (events.js:117:20)
2015-03-19 20:40:02 - error: !     at _stream_readable.js:944:16
2015-03-19 20:40:02 - error: !     at process._tickDomainCallback (node.js:492:13)
2015-03-19 20:40:02 - error: *

This is my sns object when logged

{ platformApplicationArn: 'my_sandbox_arn',
  platform: 'IOS',
  sandbox: true,
  sns:
   { config:
      { credentials: [Object],
        credentialProvider: [Object],
        region: 'us-east-1',
        logger: null,
        apiVersions: {},
        apiVersion: '2010-03-31',
        endpoint: undefined,
        httpOptions: {},
        maxRetries: undefined,
        maxRedirects: 10,
        paramValidation: true,
        sslEnabled: true,
        s3ForcePathStyle: false,
        computeChecksums: true,
        dynamoDbCrc32: true,
        accessKeyId: 'my_key_id',
        secretAccessKey: 'my_secret_key' },
     endpoint:
      { protocol: 'https:',
        host: 'sns.us-east-1.amazonaws.com',
        port: 443,
        hostname: 'sns.us-east-1.amazonaws.com',
        pathname: '/',
        path: '/',
        href: 'https://sns.us-east-1.amazonaws.com/' } },

Message sent:

{ APNS:
   { aps: { alert: 'Some message to send' },
     otherAppData: 'my data string yay' } }

it seems like this thread may leave some hints

but it looks like you're doing what needs to be done at this line

Ah I see. I was adding my own 'APNS' instead of 'APNS_SANDBOX' so you were accepting that here https://github.com/evanshortiss/sns-mobile/blob/master/lib/interface.js#L525 even though it was in sandbox mode

Happy to see you've gotten the issue resolved.

apns man...