You need to sign in to do that
Don't have an account?
Charles Langley
Hello All,
I have a question. I am attempting to do the Build an Instant Notification App project. I am trying to add some code in the Apex Class to get the SessionId as instructed in the Subscribe to Platform Event.
Here is the code:
In creating the method and trying to save it, I get the following error under the Developer Console:
unexpected token: 'String'
Can anyone please help as I don't understand why this error would come up. Thank you in advance.
Trailhead Project Build an Instant Notification App - Subscribe to Platform Event
Hello All,
I have a question. I am attempting to do the Build an Instant Notification App project. I am trying to add some code in the Apex Class to get the SessionId as instructed in the Subscribe to Platform Event.
Here is the code:
@AuraEnabled public static String getSessionId() { return UserInfo.getSessionId(); }
In creating the method and trying to save it, I get the following error under the Developer Console:
unexpected token: 'String'
Can anyone please help as I don't understand why this error would come up. Thank you in advance.
Sorry for this issue you are encountering.
I have tried the same in my developer org and everything is working fine for me.For your reference please find the below screenshot where I was successfully able to save the class.
May I suggest you please give a try by clearing all the cookies and cache in the browser you are logged in which should help.
Still, if the problem persists log out of all the accounts and give a try by attempting the same in a brand new developer org with a different browser which should probably do the trick for you.
Hope this helps.
Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Thanks,
Nagendra
All Answers
Sorry for this issue you are encountering.
I have tried the same in my developer org and everything is working fine for me.For your reference please find the below screenshot where I was successfully able to save the class.
May I suggest you please give a try by clearing all the cookies and cache in the browser you are logged in which should help.
Still, if the problem persists log out of all the accounts and give a try by attempting the same in a brand new developer org with a different browser which should probably do the trick for you.
Hope this helps.
Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Thanks,
Nagendra