I am getting my coins, but the 1,000 xp for being in a gym is not showing up on my xp count. Does it show up at a different time than the coins?
11You don't get XP for holding a gym. You get Stardust and coins, as seen here.– FrankSep 30, 2016 at 17:28
I don't see on any of the XP charts I've found that you can earn 1,000 xp just for being in a Gym.– Timmy Jim ♦Sep 30, 2016 at 17:28
You get some XP from battling in a gym, although this amount is really minor.
Battling in Gyms will give you XP points - 50XP for sparring in a friendly gym, and 150XP for a battle in a rival Gym - making it not a decent way to earn experience.
This information seems depricated on the other hand. But it looks like it has some links to the number of reputation you give or take from a gym.
But you do not get any XP from staying in a gym as Frank said.
1The numbers 50 and 150XP from the early Eurogamer article are approximative. For training in a friendly gym, the XP gain is 10% of the prestige gain, amounting to 10 to 80XP depending on the relative levels of the defending pokemon and the training pokemon. I came here looking for the exact algorithm for XP gains from attacking a gym, but I can say it is definitely not as simple as “150XP”. Oct 2, 2016 at 11:36
I updated it. That's what I thought too but didn't really take time to check the source completly. Thanks.– KarlyrOct 3, 2016 at 12:26
For the record, when attacking a gym, it appears to work this way: prestige down by 500 points per victory and 100XP for the attacker per victory. If all pokemons in place at the gym are defeated at once, the prestige points withdrawn are doubled, and there is a 50XP bonus for the attacker. I'm still not sure because this would imply that there is an exception for when the initial prestige is <2000 (only one pokemon left on the gym, one victory suffices to take it out) and there may also be a cap at 3000 prestige removed per pass. Oct 3, 2016 at 13:39