Is there any way for getting appstore id from running iOS application? (For asking user to rate it and providing link to appstore.)
Yes, it is. You can't get appstore app id (called Apple ID in iTunes Connect) offline, but you can request it using iTunes Search Api. Download the context of the following link:
http://itunes.apple.com/lookup?bundleId=YOUR_APP_BUNDLE_ID
You will get a JSON response, containing "trackId":YOUR_APP_ID
key-value. Try it in your browser!
My answer is based on the another answer: https://stackoverflow.com/a/11626157/3050403