Skip to content

Easily stan your favorite K-pop stars via an iOS 14 widget

License

Notifications You must be signed in to change notification settings

xdevplatform/micpic

Repository files navigation

🎤📸 MicPic

Easily stan your favorite K-pop stars from the comfort of your home screen via an iOS 14 widget.

This widget connects to Twitter's Recent Search to get the most recent K-pop related images. Images are detected to be about K-pop through Tweet annotations.

Widget preview

How does it work?

  1. Every day, the widget asks the Twitter API for 24 K-pop related Tweets.
  2. The timeline provider creates a Timeline with those Tweets (one per hour)
  3. WidgetKit will try to load a new image every hour or so (depending on how much screen time your widget gets, your battery status, etc.)
  4. The app requests new Tweets at the end of the timeline.

If for any reason the app fails to get a response from the Twitter API, the widget should retry every 15 minutes until it succeeds.

How do I build this app?

Start up your latest Xcode! Xcode 12 (targeting the iOS 14 SDK) should work. Before you start, you will need:

  • A valid Twitter developer account. Don't have one? Apply on Twitter Developer
  • Access to v2. If you haven't done so, create a new Project. Make sure you have an app connected to the project.
  • A Bearer token for this project. You can generate a Bearer token for your app under "Keys and tokens" in Developer Portal.

Once you have your Bearer token, locate the Info.plist under the Widget group in Xcode.

What can I do with this app?

Have fun! You can expand the widget by supporting multiple contexts, or you can try with different Tweet annotations. Change the context to 65.852262932607926273 for pets!

What if I build something cool with this sample project? What if I need help?

Let us know! If you have issues, or if you end up building something cool with this project, come see us on the Twitter Community forums!

About

Easily stan your favorite K-pop stars via an iOS 14 widget

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages