Is GKPlayer's displayName for GKLocalPlayer always "Me"? - ios6

When testing in sandbox-mode, [[GKLocalPlayer localPlayer] displayName] always returns #"Me". Does this also happen on Game Center's production servers?
Partial solution would be to use the alias property, but Apple explicitly says:
A player’s alias is used when a player is not a friend of the local
player. Typically, you never display the alias string directly in your
user interface. Instead use the displayName property.
And for displayName it says:
The display name for a player depends on whether the player is a
friend of the local player authenticated on the device. (A) If the player
is a friend of the local player, then the display name is the actual
name of the player. (B) If the player is not a friend, then the display
name is the player’s alias.
Which is preferred for the GKLocalPlayer: #"Me" or alias or something completely different? How would/did you solve this?
Related question: Game Center Player Display Name Always "me" in the sandbox

At least it is a localized "me". For example, if the system language is German, displayName is "Ich" instead of "Me".
Regarding which name to display for the local player, I think it's more of a gameplay question, so each game can decide on its own.

Related

how to store likes data in flutter

I'm developing an app in which I need to show come "coupons" I get from the API. I also have a "liked coupons" page where I need to show the ones the user has liked. I'm facing 2 problems here:
1- I don't know how to store likes, should I implement a local database for everything or should I ask our back-end team to save the liked/not liked state on the server?
2- I have a model class for coupons, and I have a coupon_list widget which is a horizontal listview.builder(). the problem is that some coupons are being showed in 2 or 3 different lists and I need them to all turn to liked when user likes an instance from a single list. how can I do that? (I want to do something like working with pointers in c++, passing the ACTUAL variable instead of it's value so it changes globally)
I would like to suggest you to store it in server as well. (Ask to your back-end team to add parameter) So that if user logout or sign in from different device "liked coupons" data will be available in all cases.
And for 2) multiple coupon entry you have to manage it via unique id. Like every coupon has its unique series no / pattern num. So you can put condition on that. i.e. Add "unique_no" to liked_list from all available list of coupon
Solution
Use Shared Preferences! This is something like a database on the device you are currently running. So if the user makes a like you can save that on their device!
To add Shared Preferences to your app look this video
Hope it helps!

append a piece of text to user's input before determining it's intent by Watson assistant engine

I want to append a piece of text to user's input before determining it's intent by Watson assistant engine
for example:
set context variable $subject = "VPN"
user input : "I want to set it up"
add context variable to the input so it becomes :
"I want to set it up $subject" ------> "I want to set it up VPN"
then after doing that watson determines which intent this input belongs to
PS: it doesn't have to be a context variable, I can append some static text
I recommend to split this problem up into intent and entities.
What is the desired action, the intent? Set something up.
What is the object / subject involved, the entity? A VPN, a computer.
That way your chatbot is more flexible and can be extended later on.
If you are already talking about VPN in a dialog, you may branch into a VPN-specific set of dialog nodes.

Shopware multilanguage catagories

Please, help. How I can create 2 categories in main and language shop with similar urls?
For example I wanna get for 2 categories food and eaten links like food and /de/food.
By default you have an own category-tree for every shop/language. Every shop needs a unique identifier (like virtual url /de or an own domain). In this case everything should work by default, without any additional configuration.
You should have a look at the s_core_rewrites_url and check which urls are created for your case.
Every url needs to be unique - so there is no possibility to get "/food" in the same language twice. By adding a unique identifier like the category-id in the seo/router configuration of the basic settings, you can modify the urls, as explained in the documentation:
https://en-community.shopware.com/_detail_1143.html
Regenerating SEO-URLs is possible via backend and via CLI

How to get Watson Assistant to capture multiple entities in context variables

I'm trying to create a Watson chatbot and I'm running into this issue.
I'm making chatbot that's helping people find organizations that provide food, shelter, drug treatment, etc.
I have a dialog node that asks the user what service they're looking for and storing it as a $service context variable.
This works well if the user says something like "I want food" as "food" gets stored into $service.
But say for instance a user says something like "I want food and drug treatment." I want Watson to then be able to store both of these variables as context variables.
How do I do that?
Its quite simple.
Just use
"service":<?#entityname.values?>
It will store all the input value of this entity in service array.

User's nick name

I have 5 types of objects in an application let's say A, B , C, D, E
The application lists objects of all type, where it shows their name, created user and other Info.
Now, to be able to show user's name in every object listing, I have some options
1) Store the USER entity key in every object and then when I retrieve say list of Objects of type A, then also retrieve user's keys and their names and then attach them to objects of type A
2) When a object of any type is created, also store a property "Name" which will be name of user who created the object (Yikes approach IMHO, what if the user changes his name later ;)
But I am not convinced both ways above are right! I am looking for an answer, from someone who might have faced similar problem
Actually you've already answered yourself, option 2 is not advisable, since an user can change his/her username, and cascading the change (manually) in the DataStore is not a good choice.
http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#ReferenceProperty
Example from the link:
class Author(db.Model):
name = db.StringProperty()
class Story(db.Model):
author = db.ReferenceProperty(Author)
story = db.get(story_key)
author_name = story.author.name
author = db.get(author_key)
stories_by_author = author.story_set.get()
The option1 can be done easily with ReferenceProperty.
No extra code needed if the performance is not your major concern.
I haven't use java on Google App Engine,
but google app engine did support object relationship you needed as well.
http://code.google.com/appengine/docs/java/datastore/jdo/relationships.html#Owned_One_to_One_Relationships

Resources