ApiProxy.getCurrentEnvironment().getAppId() returns incorrect app ID

394 views
Skip to first unread message

Artem Kuroptev

unread,
Sep 8, 2012, 9:05:19 AM9/8/12
to google-a...@googlegroups.com
Hello,

I am trying to get an id of my app using 'ApiProxy.getCurrentEnvironment().getAppId()'.

But the code returns application id with 's~' prefix. Which, I believe, somehow related to HDR datastore.

How do I receive a clear id of my application in run-time? I don't really want cut the prefix from the string, because that would looks like a hack.

Brian Michelich

unread,
Sep 11, 2012, 10:59:35 PM9/11/12
to google-a...@googlegroups.com
Have you tried this?

https://developers.google.com/appengine/docs/java/appidentity/overview#Identifying_Itself

The Application ID can be found in the ApiProxy.Environment.getAppId() method.
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/htKSv-SVFWEJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.

Artem Kuroptev

unread,
Sep 13, 2012, 12:29:54 PM9/13/12
to google-a...@googlegroups.com, br...@michelich.com
It's the same code. getAppId is not available in static context.
Reply all
Reply to author
Forward
0 new messages