TikTok restored service in the United States on Sunday after briefly going dark, as a law banning the wildly popular app on national security grounds came into effect.