How to fix invalid product ID in In-App Purchases

Yesterday after application that I’m programming for a client being rejected once again from Apple because of “inappropriate use of In-App Purchases” I had to delete old one and create a new one in iTunes Connect. Of course after that the error that I was getting while trying to test application is Invalid product id and Apple didn’t wanted to let us know anything like reason why it’s invalid so any kind of debugging is sufficient.

To solve this problem there is a simple solution.

Delete application from testing device and then let the XCode install it again. 

Because of something known only to Apple, XCode is treating installed application as application installed from App Store and it won’t allow it to register with StoreKit framework properly and that’s the reason why Invalid product id is occurring.

I have just lost a whole day waiting In-App Purchase to become valid instead of just deleting app from iPhone and installing it again. I have tested to create new In-App Purchase in iTunes connect and it was directly recognized by StoreKit and it worked directly out of the box.


If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in iPhone | Tagged , , , , , , , , , , , , | Leave a comment

Migrating Acronis backup server to another machine

Today I have migrated Acronis backup server (0lder version) to another machine.

Procedure is simple:

  • install backup server on another machine
  • configure backup location
  • stop the service
  • copy all files from old server to new server in configured backup location
  • copy C:\Document and Settings\All Users\Application Data\Acronis\Backup server dir to another server overwriting the another one
  • start the service
  • check if everything is ok with Management Console

If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in Tips and tricks | Tagged , , , , , , , | Leave a comment

Ad Hoc distribution of iOS apps over web – revised

Here is small update of my first post on Ad Hoc distribution of iOS applications over the web which you can find on this link.

I have discovered that it can be even easier to distribute apps to beta testers then the procedure which I have described in my first post.

Simplified procedure:

  1. Open XCode (version 3.2.x) and go to organizer
  2. Refresh profiles so that XCode can download Development Profile which is now automatically created within XCode if you don’t have it
  3. You don’t need distribution or AdHoc profile any more, standard development profile works as well
  4. You don’t need entitlements any more
  5. Edit release configuration to be sure that it’s signed with developer profile
  6. Set app destination platform to device, not simulator
  7. Build and archive
  8. Open XCode organizer and continue with the rest of the steps described in my first post which includes saving .ipa file to the disk and creating web dir with Beta Builder

If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in iPhone, Tips and tricks | Tagged , , , , , , , , , , | 3 Comments

Disable Cmd+Q in Firefox

There isn’t a number of situations where I pressed Cmd + Q and closed Firefox instead of Cmd + W and closing current tab and I have tried a lot of different things to stop it from custom keyboard shortcuts, to writing defaults in NSUserKeyEquivalents but without any success.

Now I have found solution.

There is experimental extension called Always Ask which solves this problem with simple popup asking you if you want to close Firefox or not.

Works like a charm.

Here is the link to it.




If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in Tips and tricks | Leave a comment

Automatic sync of CodeBox library between several macs

So yesterday Apple has released 10.6.6 update with App store for Macs. One of my first purchases was CodeBox from Vadim Shpakovski.

This application is really must have for all developers, but I have few things that I need for it to be perfect for my use.

It lacks sync between more than one Mac and I’m working on 4 different Macs, so I would like to have same code snippets everywhere without importing of every snippet separately, and you cannot export whole lib, only one code snippet at a time.

So I started looking into it to see if I can sync it in some way without too much hassle and work and I have founded way to do it.

I’m big fan of Dropbox so why not use it here.

Here are steps required to have CodeBox synced over more than one Macs:

  • Create one folder in your Dropbox folder, I have name it CodeBox :-)
  • Now quit CodeBox on one Mac (the one with more snippets)
  • Start Terminal and execute following commands
    1. cd “Library/Application Support”
    2. cp com.shpakovski.mac.codebox/* ~/Dropbox/CodeBox (here you will replace amar with your username)
    3. now we will delete folder and create symlink
    4. rm -rf com.shpakovski.mac.codebox
    5. ln -s ~/Dropbox/CodeBox com.shpakovski.mac.codebox
    6. that’s it!!

So now you need to repeat steps above on another mac on which you want to sync CodeBox library to.

If you don’t have Dropbox account create it here. It’s free and you will receive 2GB of disk space.

Note 1: This is only temporary solution, I’m sure that Vadim will implement sync option in future updates.

Note 2: Remember, you need to quit CodeBox on other Macs to be able to sync properly, because CodeBox is reading Library files on startup and it won’t know that you had changed something on mac nr2 so it will save current changes over those which are the latest ones.

Note 3: This solution works for Snippets application as well, the only thing that differs is application folder in Application Support.

Note 4: I have corrected command for creating of a symbolic link and edited rest of the commands. I don’t know how did I get L there. Thank you Dalton for pointing that out.


If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in iPhone, Tips and tricks | Tagged , , , , , , , , , , , | 9 Comments

Restoring of deleted accounts on Windows domain

Yesterday I tried to remove Exchange 2007 from Windows PDC because we have migrated to Gmail and Exchange is still eating lot of resources from it so one of the steps in removing it was to delete old mailboxes.

But (there is always at least one but) deleting of the mailboxes was including automatically deleting of user accounts on domain so in other words no one could log in on the domain or their own computers connected to domain.

Exploring MSDN and Google for solutions I have learned yesterday that deletion of objects on AD is not meaning that they are deleted directly, it’s rather that they are moved to a side for a quite long time until being deleted. So as it means that they are not deleted, restore should be easy, and it was (thinking on all possible scenarios).

There is one program called ADRestore.net which you can find on this link.

On the link above you can download program and see it in action, so in the end I have succeeded to restore all accounts with help of it.

NOTE: Restoring of the objects does not mean that all of its properties and parameters will be restored with it, so you will need to review them and fix as needed, generate new passwords and so on.


If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in Tips and tricks | Tagged , , , , , , , , , , , , | 3 Comments

Display CGRect frame values in NSLog

Here is simple tip to display frame values of any UIView with NSLog

NSLog(@”My view frame: %@”, NSStringFromCGRect(myView.frame));

After this run your app and in Debugger Console you will se output where values are written in x, y, width, height format.

My view frame: {{0, 0}, {320,421}}


If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in iPhone, Tips and tricks | Tagged , , , , , , , | 2 Comments

Custom colored grouped UITableView background image in Photoshop

As promised on Twitter to @StefaanLesage here is the .psd file with dimensions for iPhone4.

How to edit it:

  • open file
  • select foreground or background layer and apply own colors
  • select foreground layer and marquee tool
  • right click on image and load selection named Wide selection
  • press delete and then deselect selection
  • change foreground layer opacity

Save image as image_name@2x.png for iPhone4 and resize it to 320×480 and save as image_name.png for iPhone usage.

A couple of images to see how it looks like in reality.

Here is download link: Colored UITableView background (528)


If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in iPhone | 2 Comments

Create rounded UIViews with shadow

So here is small tip how to create rounded UIViews with shadow.

  • Create simple Window-based Application with name TestApp.
  • Click on File->New file and select Objective-C class with UIView subclass and name it MyView
  • Now open MyView.m and edit initWithFrame part with this code

- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
// Initialization code
[self setBackgroundColor:[UIColor blackColor]];
[self setAlpha:1];
[[self layer] setCornerRadius:8];
[[self layer] setMasksToBounds:NO];
[[self layer] setShadowColor:[UIColor blackColor].CGColor];
[[self layer] setShadowOpacity:1.0f];
[[self layer] setShadowRadius:6.0f];
[[self layer] setShadowOffset:CGSizeMake(0, 3)];
}
return self;
}

  • Now add #import <QuartzCore/QuartzCore.h> line to your MyView.m
  • Open TestAppAppDelegate.m and add #import “MyView.h” file
  • Now in application didFinishLaunching add folowing code

MyView *roundedView = [[[MyView alloc] initWithFrame:CGRectMake(100, 100, 100, 150)] autorelease];
[window addSubview:roundedView];

  • Save and run and you should have rounded black view on the main window, now add other subviews or modify by your will

Here is TestApp.zip (442) ready for download.


If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in iPhone, Tips and tricks | Tagged , , , , , , , , , | 3 Comments

Find and decrypt cisco group password on Mac

So today I wanted to move one Cisco VPN connection from my MBP to another mac.

The problem was that I didn’t received any .pcf file from admin, I got only group login and password (which I didn’t wrote down).

So after bit of searching on the disk I have found that Cisco VPN client is creating new .pcf file for every connection that you create in it. They are located in /private/etc/opt/cisco-vpnclient/Profiles directory and waiting to be exctracted. So to be able to obtain password from it do like this:

  1. open file from that directory, file will have same name as Connection name in Cisco VPN Client
  2. in the file find string enc_GroupPwd= and copy everything behind = sign
  3. open this site and copy encrypted password there, click decode button and site will return decrypted group password
  4. now you have password and you can create new connection on the another mac with details that you have on old one, host ip, group name, password, etc.

If you don't already have a Dropbox account then you can create it by clicking on my affiliate link. You will receive 2GB free account + 250 MB extra and I will receive 250 MB as well. Win-Win :-)

Posted in Tips and tricks | Tagged , , , , , , , , , | Leave a comment