I. J. Schoenberg proved that a function is positive deﬁnite in the unit sphere if and only if this function is a nonnegative linear combination of Gegenbauer polynomials. This fact plays a crucial role in Delsarte’s method for ﬁnding bounds for the density of sphere packings on spheres and Euclidean spaces. One of the most exciting applications of Delsarte’s method is a solution of the kissing number problem in dimensions 8 and 24. However, 8 and 24 are the only dimensions in which this method gives a precise result. For other dimensions (for instance, three and four) the upper bounds exceed the lower. We have found an extension of Delsarte’s method that allows to solve the kissing number problem (as well as the one-sided kissing number problem) in dimensions three and four. In this paper we also will discuss the maximal cardinalities of spherical two-distance sets. With help of the so-called polynomial method and Delsarte’s method these cardinalities can be determined for all dimensions n < 40. Recently, extensions were found of Schoenberg’s theorem for multivariate positive-deﬁnite functions. With help of these extensions and semideﬁnite programming some upper bounds for spherical codes can be improved.