Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNS Mobile push CreatePlatformApplication() does not work #136

Closed
doapp-ryanp opened this issue Aug 20, 2013 · 11 comments
Closed

SNS Mobile push CreatePlatformApplication() does not work #136

doapp-ryanp opened this issue Aug 20, 2013 · 11 comments
Labels
bug This issue is a bug.

Comments

@doapp-ryanp
Copy link

I am trying to do a createPlatformApplication and I keep getting the following cryptic error:

SNS: Top level element may not be treated as a list

Here is my code:

                $sns->createPlatformApplication(array(
                        'Name'=>"Tmp",
                        'Platform'=>'GCM',
                        'Attributes'=>array(
                            'PlatformPrincipal'=>'NA',
                            'PlatformCredential'=>'my valid api key'    
                        )                       
                ));

Has anyone else gotten this to work? Here are api docs for more details:

http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html
http://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html

I am successfully using getListPlatformApplicationsIterator() so I know I have things setup correctly. Also creating platform apps via console is working just fine.

@doapp-ryanp
Copy link
Author

doapp-ryanp commented Aug 20, 2013

So I added debug of what is going over the wire and it looks like guzzle is messing up the format...

...
$sns->addSubscriber(LogPlugin::getDebugPlugin());
...

Output:

...
Action=CreatePlatformApplication&Version=2010-03-31&Name=Tmp&Platform=GCM&Attributes.1.Name=PlatformPrincipal&Attributes.1.Value=NA&Attributes.2.Name=PlatformCredential&Attributes.2.Value=myValidApiKey
...

When it should look something like (note missing 'entry' and 'Name' instead of 'key' and 'Value' instead of 'value':

Attributes.entry.2.key=PlatformPrincipal
&SignatureMethod=HmacSHA256
&Attributes.entry.1.value=******2zEKTLYYo645zfk2jhQPFeyxDo
&Attributes.entry.2.value=There+is+no+principal+for+GCM
&AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE
&Signature=82sHzg1Wfbgisw3i%2BHA2OgBmRktsqUKFinknkq3u%2FQ4%3D
&Timestamp=2013-07-01T15%3A49%3A50.354Z
&Name=gcmpushapp
&Attributes.entry.1.key=PlatformCredential
&Action=CreatePlatformApplication
&Version=2010-03-31
&SignatureVersion=2
&Platform=GCM

@jeremeamia
Copy link
Contributor

We are looking into this, but it looks like there definitely is a problem.

@doapp-ryanp
Copy link
Author

Thanks. I also tried setting the sentAs attr in the sns resource but that did not make a difference. My guzzle knowledge is not that deep - otherwise I'd spend more time trying to submit a fix.

Once you fix, can you please make sure to test all the new Push service related methods, as this is blocking us - would like to avoid this method getting fixed but running into issues in the others.

@doapp-ryanp
Copy link
Author

Sorry, I know this was just reported, but any idea a timeline for this fix? days/weeks? Thinking that if its in guzzle land it make take a while.

We are trying to get this into our production apps, and trying to decide if we should go another direction (maybe write some java code using the aws sdk for java)

@mtdowling
Copy link
Member

This is an SDK specific issue. This issue will likely be fixed and packaged into a release early next week.

@jeremeamia
Copy link
Contributor

Hey @doapp-ryanp, I am working on a fix for this right now in PR #139. I am doing some more testing before I merge it into master, but I wanted to let you know about it in case you want to give it a try.

@doapp-ryanp
Copy link
Author

@jeremeamia thanks for the heads up. I wont be able to get to it for another day or so. My composer dependency chain makes it hard for me to test non tagged versions - so I'll probably wait til it gets into one.

@jeremeamia
Copy link
Contributor

OK, I merged this into master now, so stay tuned for a release sometime soon.

@jeremeamia
Copy link
Contributor

Now released in 2.4.4.

@doapp-ryanp
Copy link
Author

Thanks!

@biranchi2018
Copy link

Why this bug is closed ?
Its 2018 and the bug still exits......

sns.createPlatformApplication promise does not return anything, either success or failure.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants