In this work, tunable NH 3 uptake of polyionic liquids (PILs) are reported through regulating the size of the cross-linking agent R, the metallic anion M(II) (SCN) 4 2− , where M are Co, Zn, and Cu, and the cationic polymer framework of PILs. Combined with NH 3 uptake experiments, spectroscopic analysis, and DFT calculation, the NH 3 uptake was proposed as the coordination with M(II) to generate M(NH 3 ) n 2+ , where n = 6 when M = Co and n = 4 when M = Cu and Zn, which suggests that the NH 3 capacity is dominated by the metal center for different coordinative numbers. The increase in the size of R benefits the high capacity of NH 3 uptake for more metallic anions to be exchanged and promotes NH 3 desorption for the enhancement of porosity of PILs; however, the oversize of R goes against porosity and NH 3 desorption. There seems to be less effect of the cation on ammonia uptake, while the stable cationic polymer framework protects the PILs from collapse. Overall, the tunable porosity (surface area of 15.9−869.0 m 2 /g and total volume of pores of 0.011−0.695 cm 3 /g) and NH 3 uptake properties (capacity of 11.6−20.1 mmol/g PIL) as well as feasible NH 3 desorption of PILs are realized for the flexible structural design of PILs. Furthermore, the adsorbed H 2 O and SO 2 on NH 3 uptake of PVIm-R8-Co were investigated. The investigation in this work makes the role of the structure of PILs in ammonia uptake clearer and provides the designability of PILs for gas adsorption and other applications.