How can i combine location based service in passbook ios6? - ios6

I see
Passbook can use location and time data to launch the passes when the app believes you will want to use them.
in apple doc.
So can i send push notification when my customers approach a particular location? If yes, how can i do it?
Is there any tutorial online?
Thx

In your pass.json file add location tag also
"locations" : [
{"latitude" : 8.5682,
"longitude" : 76.87349,
"relevantText" : "Store nearby on 3rd and Main."}
],
Change the iphone general location settings to ON
Go through apples programming guide
https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/PassKit_PG/Chapters/Creating.html#//apple_ref/doc/uid/TP40012195-CH4-SW53

In short, No. This is because Passbook does not make any callbacks when a location alert is triggered.
Apple refer to location alerts as 'passive alerts'. Their purpose is to recognise that the user may need the pass and to make it available to him. There is no direct or indirect data that will tell us that a location alert has been triggered and certainly nothing that could trigger a push notification.

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!

mgt-react PeoplePicker defaultSelectedUsers not working as I would expect

I've been writing a React app that relies on the mgt-react components.
The app is basically just an interface to a SharePoint library.
Everything has been working great and the PeoplePicker is working in so much as I can start typing a users name and the drop down works and I can select a person.
However now I'm at the point where I want to create an edit screen. In order to implement this I need to prepopulate the PeoplePicker with the users that were input at insert time.
I can't seem to get the "defaultSelectedUsers" property to work.
I've pared things down to simply hardcoding a users email address and it still doesn't work.
Here is my code for the component (email address changed for privacy reasons):
<PeoplePicker defaultSelectedUsers={['user#domain.com']} selectionMode="single" selectionChanged={handleSelectionChanged}></PeoplePicker>
No matter what I do it is not prepopulating with a user / person.
The permissions are all there (I think) which is proven by the component working when I start typing a user name.
Any ideas what I might be missing?
As always thanks so much for any input in advance.
----- edit ----
Oh okay, it seems that I can't use that prop with mgt-react? I have to use defultSelectedUserIds and can't just provide an email address. Can someone confirm this is the case?
Is there mgt documentation for the defaultSelectedUsers property? As far as I am aware, the people picker only supports defaultSelectedUsersById. The email address should work though, assuming the graph is able to retrieve the users (it's their actual id).
For a quick test, are you able to retrieve the users through the graph explorer with the /users/${id} (replace id with your email) filter? This is what we use for the property.

How can I get merged data from website and mobile website for Google Analytics?

I have a website - and the website redirects the users automatically to its mobile site when the users access using mobile devices.
The problem is, Google Analytics treats those two pages as a separate page.
For exmaple,
http://story.pxd.co.kr/917 and
http://story.pxd.co.kr/m/post/917
are same page but GA shows statistics as two different pages.
How can I merge the data from the two pages?
(When I want to see mobile data only, GA already supports various ways for it)
Thank you in advance.
Jay
Untested as far as the regex goes and might need a little refinement, but the principle works like this:
Go to admin, views, filters. Create a new filter , custom, advanced.
In "Field A" select "Request Uri" from the dropdown.
In the text field at the right (extract) enter "./m(.)" (without quotes). This extracts everything to the right of /m via and stores it (via the brackets) in variable (if it does not work at the first go you have to look up regexp with Google and refine). The values of that variable now should be in your example "/post/917", it is accessible later via the placeholder $A1 ("A" because it's from field A, "1" because it is the first value extracted. If you use more than one bracket you might also have $A2, $A3 etc).
Leave Field B empty.
In "Output To" select "Request Uri". Enter your hostname http://story.pxd.co.kr/ . Append the placeholder $A1 - this contains the page path without the "m".
All steps combined will change "http://story.pxd.co.kr/m/post/917" to "http://story.pxd.co.kr/post/917" and thus unify the urls so they will be displayed as the same page in the reports (you might want to include some custom dimension to discern if this was a mobile view or a desktop view, or you can use the "device category" as second dimension to see which was which).
Btw. data that has already been recorded will not be changed, filters do not work on historical data. And be sure to keep a view without filters (filters are destructive and if you make a mistake you won't be able to recover the data).
Thank you Eike,
With your hint, I found better way.
I used 'Advanced Filter' with 'Search and Replace'
So let the GA search /m/post/ and replace with /
Thank you!

Drupal Replacement Pattern for Entity Reference

I have a Profile Type attached to a user. In there I have a Entity Reference Field of Program Manager. I have Live Events(content-type) that people can register for. I set up a Rule to Email the Program Manager every time someone registers.
My problem is I am trying to pull information from the Profile based on the the entity reference for the Program Manager.
I have the field printing out by using this pattern...
[registration:entity:field_program_manager]
However when I try to pull the first name, email of phone I can not get it to show up.
Does anyone have any ideas to share?
Many Thanks!
Okay so I was trying to solve for sending the email to the Author of the page but was having issues. So I created a new fields hoping it would be easier. In trying to solve for this I solved the original issue.
To print the Author of a node to an email through Rules actions us this.
[registration:entity:author]
So for first name it would be:
[registration:entity:author:profile-main:field_first_name]
Hope it helps someone else.
If you're using entityform instead of a node and referencing the default user info (not the 'Main Profile' profile type), then you want to use something like
[entityform:field-staff-entity-ref:field-work-email]
In this case, 'field-staff-entity-ref' is the entity reference field in the entityform and 'field-work-email' is the field in the user's account settings.

Show Opportunity related Contacts in Custom Object Field

I have the next issue.
I have a custom object called 'Application', and I have this requirement:
"Show all Contacts related to an Application. Create a field on Application object, must be read only".
I solve it with apex code. 'Application' has a lookup to Opportunity, Opportunity to Account, and all my contacts have AccountId, so this way, I get all the contacts using apex code in a trigger.
But, I've been ask to change this to a Formula field in Application object.
So, my issue is next. I'm not able to get all contacts with advance formula editor, because they're not part of any object. I have no master-detail relationship.
Does any one know how can I achieve this using configuration? I should not use apex code for this req.
Thank in advance guys.
I don't think you can do it.
In formulas / merge fields syntax there's no way to go "up, up then down" (Application -> Opportunity -> Account -> down to Contacts related list). There's also nothing that would let you loop through Contacts (and display what? Ids? Names? Emails?). Roughly speaking you can only go up through dots.
You might want to explore path of "cross object workflow" rules but I imagine that when I add a new Contact to Account it should somehow "spread itself" to all related Applications? There's no straight way to fire a workflow on delete too - so you'd eventually end up with inaccurate list.
I'd say trigger was a good solution. Maybe it ws unoptimized but if it has to be in a field - tough.
There might be a fairly simple way of achieving that by embedding a visualforce page within Application page layout.
This should be doable with pure Visualforce (so technically there will be no Apex code ;))
Something as simple as
<apex:relatedList list="Contacts" subject="Application__c.Opportunity__r.AccountId" />
would be a good start (if you want your own layout and not a rel. list - you should be still able to pull it off with <apex:repeat> or <apex:pageBlockTable>.
There's one BUT here: it's not a field, just a display trick. Forget about using it in reports, mobile applications etc.
Another way - would it be acceptable to be 1 click away from these contacts? You could make a report "Account with Contacts", filter it by Id of one Account and later use "URL hacking" to change the filter depending on from which Application you'll click it. This link could be either a formula field or a real custom button/link. Technically - it's pure config, no apex & VF.
You can read more about URL hacking at Ray Dehler's excellent post and specifically about dynamic Reports here or here.

Resources