Foursquare API place icon background color - ios

I have been using Foursuare API to list nearby places in my IOS app.Following is the url to get the icon image:
https://ss1.4sqi.net/img/categories_v2/food/default_64.png
Response is white icon with white background color. So its not seen in my App. Please suggest me a way to get the icon with different colors.

If you insert bg into the URL, you can get a version of the icon with a background color: https://ss1.4sqi.net/img/categories_v2/food/default_bg_64.png
See our full category documentation for more info!

Related

IOS NotificationContentExtension background color to match the theme

Hello
When creating NotificationContentExtension I can control the background color. I can also detect if the user has a dark or light theme.
I'd like to change the contentExtension background to either dark or light background to match the iPhone colors.
How can I get (preferably in runtime) the colors of the theme? Just to be clear - in the image attached you can see the notification has a "dark" header. I'd like to know the color of it exactly so I can match the content to be the same color. (instead of the current "black" color)
You can use UIColor.systemBackground
https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors

How do I change the color of the push notification icon in flutter? [duplicate]

I tried making the small icon exactly 16x16, gray-scaled, nothing but gray and white (the gray color being hex value 616161), to create a silhouette of my application icon.
Yet no matter what it just shows up as a white/gray square in the notifications. What am I doing wrong?
(My min api is 21, assuming it is relevant)
Follow this link
First let’s understand the Android documentation which is as follows
“Update or remove assets that involve color. The system ignores all
non-alpha channels in action icons and in the main notification icon.
You should assume that these icons will be alpha-only. The system
draws notification icons in white and action icons in dark gray.”
Now this is easy to miss and I have seen many apps that are live in the app store with thousands of users who haven’t followed the mentioned guidelines.
So let me explain in detail how you can convert your notification icon to an Android friendly one with a few clicks.
In your favourite image editor open up your icon file. Convert all parts of the image that you don’t want to show to transparent pixels. All colors and non transparent pixels are displayed in white. Let us go through an example.
EDITED: Thanks #Andrey Patseiko for the tool
For notification you have to use different icons for different versions of android:
Notification notification = new Notification.Builder(context)
.setAutoCancel(true)
.setContentTitle("My notification")
.setContentText("Look, white in Lollipop, else color!")
.setSmallIcon(getNotificationIcon())
.build();
return notification;
Get notification icon on the basis of version
private int getNotificationIcon() {
boolean useWhiteIcon = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP);
return useWhiteIcon ? R.drawable.icon_silhouette : R.drawable.ic_launcher;
}
Along with new features and capabilities, Android 5.0 includes a variety of system changes and API behavior changes. See the notification behavior changes.
Notifications are drawn with dark text atop white (or very light)
backgrounds to match the new material design widgets. Make sure that
all your notifications look right with the new color scheme. If your
notifications look wrong, fix them:
Use setColor() to set an accent color in a circle behind your icon image.
Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon.
You should assume that these icons will be alpha-only. The system
draws notification icons in white and action icons in dark gray.
So, basically you have to use silhouette icons as notification icon for API Level 21+

3D Touch shortcuts - Color Icon

I know how to develop 3D touch shortcuts with customized icon (grayscale) but my question is is there any possiblility to put colored image as a shortcut icon? I have tried a colored image with
UIApplicationShortcutIcon *logoIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:#"field_valid"]
...but it won't appear. With a grayscale icon, it is working fine.
Sure you can but only with contact images.
See UIApplicationShortcutIcon:
init(contact: CNContact)
Creates a Home screen quick action icon
from the picture for a contact if available, or else creates a
monogram from the contact name.
Source: https://developer.apple.com/documentation/uikit/uiapplicationshortcuticon
According to iOS Human Interface Guidelines, this is not permitted.
From the Home Screen Actions section:
Don't use an emoji in place of an icon. Emojis don't align properly with right-aligned text. Also, emojis are full color, whereas quick action icons are monochromatic.

iOS 10, Swift 3 - change inactive bar item icon?

I was trying to find answer to my problem but I couldn't figure it out.
I've imported my own icons to icons assets which are white and in .png format and I want to use them in tab bar item. Everything works great but when the screen is inactive the icon is gray. I want it to be white as original. I've tried to change "render as" in assets but then the icon doesn't change when the screen gets active.
Is there any way to fix it?
Thanks for all help. https://i.stack.imgur.com/mzDl3.png
TRY THIS-:
var image = UIImage(named:"your image")?.withRenderingMode(.alwaysOriginal)

How to set title background transparent in the iMovie 10.0.6 for the application preview

For the iOS8 application, the AppStore have to upload the preview. With the Yosemite, I use the newset iMovie(10.0.6) to make the application preview. I just want to add some title or text over the video, but i find something dispointed. There is no way to set title background color transparent, that is impossible.!
![]

Resources